FacesContext facesContext = FacesContext.getCurrentInstance();
Wizard wizardObject = (Wizard) controller.getValue(facesContext.getELContext());
List<WizardStep> course = wizardObject.getCourse();
PanelTag panel = new PanelTag();
panel.setPageContext(pageContext);
panel.setParent(getParent());
panel.doStartTag();
FacetTag facetTag = new FacetTag();
facetTag.setPageContext(pageContext);
facetTag.setName(Facets.LAYOUT);
facetTag.setParent(panel);
facetTag.doStartTag();
GridLayoutTag gridLayoutTag = new GridLayoutTag();
gridLayoutTag.setPageContext(pageContext);
StringBuilder columns = new StringBuilder();
for (WizardStep info : course) {
columns.append("auto;");
}
gridLayoutTag.setColumns(createStringValueExpression(columns + "*"));
gridLayoutTag.setParent(facetTag);
gridLayoutTag.doStartTag();
gridLayoutTag.doEndTag();
facetTag.doEndTag();
for (WizardStep info : course) {
ButtonTag button = new ButtonTag();
button.setPageContext(pageContext);
button.setParent(panel);
//todo button.setAction(info.getOutcome());
//todo button.setActionListener("#{" + wizard + ".gotoStep}");
//todo button.setLabel(info.getTitle());
button.doStartTag();
AttributeTag step = new AttributeTag();
step.setPageContext(pageContext);
step.setParent(button);
//todo step.setName("step");
//todo step.setValue("" + info.getIndex());
step.doStartTag();
step.doEndTag();
button.doEndTag();
}
OutTag spacer = new OutTag();
spacer.setPageContext(pageContext);
spacer.setParent(panel);
//todo spacer.setValue("#{" + wizard + ".index}");
spacer.doStartTag();
spacer.doEndTag();
panel.doEndTag();
return result;
}