【发布时间】:2014-09-20 09:10:24
【问题描述】:
我正在使用 jsf 2.2 和 primefaces 来开发 Web 应用程序。我希望根据用户选择的不同选项转到一个页面或另一个页面。如果用户选择控制台PS4和伦敦城市去page1.xhtml,如果他选择控制台xbox和城市巴黎去page2.xhtml怎么办?
代码如下:
<h:form>
<h3 style="margin-top:0">Basic</h3>
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="console" value="Console:" />
<p:selectOneRadio id="console" value="#{radioView.console}">
<f:selectItem itemLabel="Xbox One" itemValue="Xbox One" />
<f:selectItem itemLabel="PS4" itemValue="PS+" />
<f:selectItem itemLabel="Wii U" itemValue="Wii U" />
</p:selectOneRadio>
</h:panelGrid>
<h3 style="margin-top:0">Basic</h3>
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<p:outputLabel for="city" value="city:" />
<p:selectOneRadio id="city" value="#{radioView.city}">
<f:selectItem itemLabel="London" itemValue="london" />
<f:selectItem itemLabel="Paris" itemValue="paris" />
<f:selectItem itemLabel="NY" itemValue=ny" />
</p:selectOneRadio>
</h:panelGrid>
【问题讨论】:
标签: javascript jsf primefaces navigation