I am trying to make a drop down box, which gets choices from a database held on a Glassfish server. I have managed to achieve this. The next step was to have the choices from the user appear on the next page. I have attempted to do this by doing this
index.xhtml
<h:selectOneMenu value="#{mealBean.monLunch}">
<f:selectItems value="#{mealBean.getMealsByTime('Lunch')}"/>
</h:selectOneMenu>
There is a command button linking to the results.xhtml from index.xhtml as follows
Bean
public String monLunch;
public String monDinner;
public String getMonLunch() {
return monLunch;
}
public void setMonLunch(String monLunch) {
this.monLunch = monLunch;
}
public void setMonDinner(String monDinner) {
this.monDinner = monDinner;
}
public String getMonDinner() {
return monDinner;
}
and then on the results.xhtml
#{mealBean.monLunch}
My issue is, when I click the command button, the data does not appear on the new page. Is there a way to remedy this? Any help would be appreciated. Thank you in advanced