Alright, so I have been trying for ages to solve this myself but it is impossible. I have a form with a radio button in my xhtml. The radio button included in the form is supposed to get a list of Objects use these as select items. These values are correctly retrieved and displayed in the options of the radio button. However, when I am actually trying to save one of these values by calling the equivalent setter nothing happens (i.e. the setter is never called). My form has the following structure:
...
<h:form id="xform">
<p:selectOneRadio id="supervisor" value="#{cntrl.demo}" layout="grid" columns="3">
<f:selectItems value="#{cntrl.demos}" var="s" itemLabel="#{s}" itemValue="#{s}"/>
</p:selectOneRadio>
<p:commandButton value="submit" action="#{cntrl.register}" update="xform"/>
</h:form>
My Cntrl
class contains the following methods:
@Named
@ViewScoped
public class Cntrl implements Serializable{
public void register() {
//do some stuff
}
public void setDemo(Demo demo) {
this.demo = demo;
}
public List<Demo> getDemos() {
return demos;
}
///...more code
}
So the getDemos
is properly called and the buttons are properly populated etc. However the setDemo
never gets called