I am using jsf 2.2 and primefaces to develop a web application. I want depending on the different options the user chooses go to one page or another. How can I do if the user chooses the console PS4 and the city London go to page1.xhtml, and if he chooses console xbox and city paris go to page2.xhtml ?
Here is the code:
<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>