I have a problem using f:ajax with t:selectOneRadio in layout="spread"
Without layout="spread", this is working :
<t:selectOneRadio id="test" value="#{bean.type}" >
<f:selectItem itemLabel="yes" itemValue="1"/>
<f:selectItem itemLabel="no" itemValue="0"/>
<f:ajax render="label" />
</t:selectOneRadio>
<h:panelGroup id="label" layout="block">
<h:outputText value="OK" rendered="#{bean.type == 1}"/>
<h:outputText value="KO" rendered="#{bean.type == 0}"/>
</h:panelGroup>
When i click on a radio, the text is modified, my type attribute is set in my bean as expected. My bean is :
@ManagedBean
@ViewScoped
public class Bean {
private String type;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
But With layout="spread", my bean is not set, the setter is not call, but the render works (to test it, inscpect the html, write foo in the div with id="label" and after clicking a radio the text is clear because of the render.
My code with layout="spread" :
<t:selectOneRadio id="test" value="#{bean.type}" layout="spread">
<f:selectItem itemLabel="yes" itemValue="1"/>
<f:selectItem itemLabel="no" itemValue="0"/>
<f:ajax render="label" />
</t:selectOneRadio>
<div><t:radio id="radio1" for="test" index="0"/></div>
<div><t:radio id="radio2" for="test" index="1"/></div>
<h:panelGroup id="label" layout="block">
<h:outputText value="OK" rendered="#{bean.type == 1}"/>
<h:outputText value="KO" rendered="#{bean.type == 0}"/>
</h:panelGroup>
I have tomahawk2.1 in version 1.1.14 and JSF myfaces 2.2.8