xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/layouts/standard.xhtml">
<ui:define name="title">#{msg['application_name']}</ui:define>
<ui:define name="content">
<h1>Contact</h1>
<h:form >
<h3>
<h:outputText value="#{msg['label_contact_first_name']}: "/>
<h:outputText value="#{contact.firstName}"/>
<br/>
<h:outputText value="#{msg['label_contact_last_name']}: "/>
<h:outputText value="#{contact.lastName}"/>
<br/>
<h:outputText value="#{msg['label_contact_birth_date']}: "/>
<h:outputText value="#{contact.birthDate}">
<f:converter converterId="jodaDataTimeConverter" />
</h:outputText>
</h3>
<h3>#{msg['label_contact_hobbies']}</h3>
<p:dataList value="#{contact.hobbiesAsList}" var="hobby">
#{hobby.hobbyId}
</p:dataList>
<br/>
<p:toolbar>
<p:toolbarGroup align="left">
<p:commandButton value="Back" action="back"/>
</p:toolbarGroup>
</p:toolbar>
</h:form>
</ui:define>
</ui:composition>
In Listing 18-13, the contact information is rendered based on the properties stored in the contact
variable. Note that for rendering the hobbies information, the Contact object's transient method
getHobbiesAsList() is called. The reason is that JSF is not able to render detail information stored in a
Set. So, the helper method getHobbiesAsList() is implemented to return the hobbies as a List.
To test the show contact view, select a row and then click the View Selected button. Then the
contact information will be displayed, as shown in Figure 18-16.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home