HTML and CSS Reference
In-Depth Information
<p:column headerText="City">
<h:outputText value="#{city.name}" />
</p:column>
<p:column headerText="Population">
<h:outputText value="#{city.population}" />
</p:column>
</p:dataTable>
</p:outputPanel>
</h:form>
</h:body>
</html>
In order to populate the country and city data, the CountryNavigator managed bean instance is created and
initialized as shown in the Faces configuration in Listing 9-7 (note that some of the lines are omitted to save the space).
Listing 9-7. Faces Configuration File
<?xml version='1.0' encoding='UTF-8'?>
<faces-config ...>
<managed-bean>
<managed-bean-name>countryNavigator</managed-bean-name>
<managed-bean-class>com.jsfprohtml5.countrynavigator.model.CountryNavigator</managed-bean-
class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>countries</property-name>
<list-entries>
<value>#{egypt}</value>
<value-class>com.jsfprohtml5.countrynavigator.model.Country</value-class>
<value>#{germany}</value>
<value-class>com.jsfprohtml5.countrynavigator.model.Country</value-class>
<value>#{brazil}</value>
<value-class>com.jsfprohtml5.countrynavigator.model.Country</value-class>
</list-entries>
</managed-property>
</managed-bean>
<!-- Egypt -->
<managed-bean>
<managed-bean-name>egypt</managed-bean-name>
<managed-bean-class>com.jsfprohtml5.countrynavigator.model.Country</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>name</property-name>
<value>Egypt</value>
</managed-property>
 
Search WWH ::




Custom Search