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