radio button list
hi,
i have a radio button list and want to select one before the page will load!!
is this possible and how can i do this!
this is my code!
<h:selectOneRadio value="#{testBean.sortMode}" onchange="this.form.submit();">
<f:selectItems
value="#{testBean.sortModeList}" />
</h:selectOneRadio>
I hope this will help you
on mainPage.jspthe user selcets a commandLink that calls
nextPage method.
Within the nextPage method.
FacesContext facesContext = FacesContext.getCurrentInstance();
testBean.sortMode test = (testBean)app.createValueBinding("#{testBean}").getValue(facesContext);
know the test object has a copy of the testBean that is stored in the users session
test.setSortMode("Desc");
return("nextPage")
so then on the nextPage.jsp the sortMode will have a default value.
<h:selectOneRadio value="#{testBean.sortMode}" onchange="this.form.submit();">
<f:selectItems value="#{testBean.sortModeList}" />
</h:selectOneRadio>
Hope this helps