p:selectOneRadio always initializes with no radio button activated, although the value attribute is assigned to an existing object of a backed bean.
Here's an example:
Code: Select all
<p:selectOneRadio value="#{registration.selectedEventTypeId}">
<f:selectItem itemLabel="Kurs" itemValue="1" />
<f:selectItem itemLabel="Veranstaltung" itemValue="2" />
</p:selectOneRadio>
Code: Select all
public class Registration {
// eventType
private Integer selectedEventTypeId;
/** Creates a new instance of registration */
public Registration() {
this.selectedEventTypeId = 1;
}
public Integer getSelectedEventTypeId() {
return selectedEventTypeId;
}
public void setSelectedEventTypeId(Integer selectedEventTypeId) {
this.selectedEventTypeId = selectedEventTypeId;
}
}
It works only when assigned the value attribute directly to e. g. "1" not using the expression language.
Btw, the above mentioned example works perfect when using h:selectOneRadio.
Any ideas?
BR
Martin