Java Reference
In-Depth Information
The following screenshot shows a PrimeFaces-specific version of the registration
application we developed in the previous chapter:
As we can see, the application renders beautifully and all we had to do was replace
standard JSF components with their PrimeFaces-specific counterparts. Notice that
an asterisk is automatically added to the label for all the required fields.
The following snippet shows the relevant parts of the markup to generate the
registration page:
<p:messages/>
<h:form>
<p:panelGrid columns="2"
columnClasses="rightalign,leftalign">
<p:outputLabel value="Salutation: " for="salutation"/>
<p:selectOneMenu id="salutation" label="Salutation"
value="#{registrationBean.
salutation}">
<f:selectItem itemLabel="" itemValue=""/>
<f:selectItem itemLabel="Mr." itemValue="MR"/>
<f:selectItem itemLabel="Mrs." itemValue="MRS"/>
<f:selectItem itemLabel="Miss" itemValue="MISS"/>
<f:selectItem itemLabel="Ms" itemValue="MS"/>
<f:selectItem itemLabel="Dr." itemValue="DR"/>
</p:selectOneMenu>
<p:outputLabel value="First Name:" for="firstName"/>
<p:inputText id="firstName" label="First Name"
required="true"
value="#{registrationBean.firstName}" />
<p:outputLabel value="Last Name:" for="lastName"/>
<p:inputText id="lastName" label="Last Name"
required="true"
 
Search WWH ::




Custom Search