HTML and CSS Reference
In-Depth Information
public void setName(String name) {
this.name = name;
}
public long getPopulation() {
return population;
}
public void setPopulation(long population) {
this.population = population;
}
}
Listing 9-6 shows the complete code of the Country Navigator application page which consolidates ring
component with the "details" panel part.
Listing 9-6. Country Navigator Application Page Code
<html xmlns=" http://www.w3.org/1999/xhtml "
xmlns:h=" http://java.sun.com/jsf/html "
xmlns:f=" http://java.sun.com/jsf/core "
xmlns:ui=" http://java.sun.com/jsf/facelets "
xmlns:p=" http://primefaces.org/ui " >
<h:head>
<title>Welcome to the Country Navigator</title>
<h:outputStylesheet library="css" name="countryNavigator.css" />
</h:head>
<h:body>
<h:form id="form">
<h2>Click on a country to get its details</h2>
<p:ring id="custom" value="#{countryNavigator.countries}" var="country"
styleClass="image-ring" easing="swing">
<p:commandLink update=":form:detail">
<p:graphicImage value="/images/#{country.name}.gif"
styleClass="flagIcon" />
<f:setPropertyActionListener value="#{country}"
target="#{countryNavigator.
activeCountry}" />
</p:commandLink>
</p:ring>
<p:outputPanel id="detail" styleClass="detailsPanel" layout="block">
<p:dataTable var="city" value="#{countryNavigator.activeCountry.cities}"
rendered="#{countryNavigator.activeCountry ne null}">
<f:facet name="header">
#{countryNavigator.activeCountry.name}
</f:facet>
 
Search WWH ::




Custom Search