Java Reference
In-Depth Information
value="#{customer.
mobilePhone}" />
<h:outputText value="Work Phone"
styleClass="optionalLbl"/>
<h:outputText id="workPhoneTxt"
value="#{customer.
workPhone}" />
<h:panelGroup/>
<h:inputHidden value="#{customer.
addrState}"/>
<p:commandButton id="submitButton"
value="Submit"
actionListener=
"#{customerController.saveCustomer}"
ajax="false"/>
</h:panelGrid>
</p:tab>
</p:wizard>
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition> </
html>
Some of the wizard pages or "tabs" in the above example were omitted
for brevity. Refer to the code download for this chapter for the complete
listing.
As we can see, generating a wizard interface with PrimeFaces is easy. All we need to
do is use the <p:wizard> component, then nest a <p:tab> component for each step
in the wizard. Markup inside each <p:tab> component is standard JSF.
In the last tab, we added a <p:commandButton> component to submit the data to
the server The value of the actionListener attribute of the commandButton is a
method in our CustomerController managed bean.
package com.ensode.primefacesdemo.managedbeans;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped; im-
port javax.faces.event.ActionEvent; import
javax.faces.application.FacesMessage; import
javax.faces.context.FacesContext;
 
Search WWH ::




Custom Search