0
我正在使用jsf 2.2和primefaces开发一个web应用程序。我希望根据用户选择的不同选项转到一个页面或另一个页面。如果用户选择控制台PS4和伦敦城市转到page1.xhtml,并且他选择控制台xbox和城市巴黎转到page2.xhtml,我该怎么办?JSF和Primefaces条件导航
下面是代码:
<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>
谢谢,但它不工作。我做错了什么。在托管bean选项中应该声明为公共字符串,对吗? – william 2014-09-20 16:56:28