Code: Select all
<p:dialog header="#{msg.dialogUserTableHeader}" widgetVar="bindDialog"
resizable="true" showEffect="clip" hideEffect="fold"
styleClass="panel">
<h:panelGrid id="wizardContent">
<h:panelGrid rendered="#{wizardController.step eq 1}">
<p:commandButton id="test1" value="Test1"
actionListener="#{wizardController.finish}" />
</h:panelGrid>
<h:panelGrid rendered="#{wizardController.step eq 2}">
<p:commandButton id="test2" value="Test2"
actionListener="#{wizardController.finish}" />
</h:panelGrid>
</h:panelGrid>
<p:commandButton value="Next" update="wizardContent"
actionListener="#{wizardController.next}" />
<h:panelGrid columns="2" styleClass="dialogButtons">
<p:commandButton value="#{msg.cancelButton}"
onclick="bindDialog.hide();" />
</h:panelGrid>
</p:dialog>
Code: Select all
@ManagedBean(name = "wizardController")
@RequestScoped
public class WizardController {
private Integer stepCounter = 1;
public WizardController(){}
public Integer getStep(){
return stepCounter;
}
public void next(){
stepCounter++;
System.out.println("next");
}
public void finish(){
System.out.println("finish");
}
}
Thank you. I use PF-3.0M3, Mojarra - 2.1.3, Tomcat 6.