1 2 3 4 5 6 7 8 | <h:panelGrid columns="2"> <hutputText value="Enter your name:"/> <h:inputText id="txtName" value="#{person.name}"> <f:ajax render="txtEnteredName"/> </h:inputText> <hutputText value="You entered: "/> <hutputText id="txtEnteredName" value="#{person.name}"/> </h:panelGrid> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <!-- some code here --> <h:dataTable value="#{countryTable.data}" var="row"> <!-- some code here --> <h:column> <f:facet name="header"> <hutputText value="Action"/> </f:facet> <h:commandLink id="cmdShow" value="View Country Location"> <f:ajax render="mapGroup"> <f:param name="selectedCapital" value="#{row.capital}"/> <f:param name="continent" value="#{row.continent}"/> <f:param name="selectedCountry" value="#{row.id}"/> </f:ajax> </h:commandLink> </h:column> </h:dataTable> <!-- some code here --> <h:panelGroup id="mapGroup"> <m:map id="map" width="460px" height="460px" type="G_NORMAL_MAP" address="#{param.selectedCountry}" rendered="#{param.selectedCountry ne null}" renderOnWindowLoad="false" zoom="4"> <m:marker id="marker"/> <m:htmlInformationWindow id="window" htmlText="Country: #{param.selectedCapital} <br/> Continent: #{param.continent}"/> </m:map> <!-- some code here --> </h:panelGroup> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | @ManagedBean(name="countryTable") @RequestScoped public class CountryTableModel { private static List<Country> data = new ArrayList<Country>(); static { data.add(new Country("Egypt", "Cairo, Egypt", "Africa")); data.add(new Country("Germany", "Berlin, Germany", "Europe")); data.add(new Country("Austria", "Vienna, Austria", "Europe")); data.add(new Country("US" , "Washington, USA", "North America")); data.add(new Country("China" , "Beijing, China", "Asia")); data.add(new Country("Brazil" , "Brazilia, Brazil", "South America")); } public List<Country> getData() { return data; } public void setData(List<Country> data) { this.data = data; } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |