<h:form>
<h:messages />
<h:selectOneRadio value="#{bean.selectedValue}" id="selectId"
layout="pageDirection">
<f:selectItems value="#{bean.values}" var="value"
itemLabel="#{value.text}" itemValue="{value}" />
</h:selectOneRadio>
<h:commandButton value="Press Me" >
<f:ajax listener="#{bean.btn_action}" execute="@form"/>
</h:commandButton>
</h:form>
Below are code details.
- Bean is backing bean in @ViewScope.
- bean.values is list of another managed bean which is in @RequestScope.
- Radio button value is binded to above @RequestScope managed bean in backing bean. #{bean.selectedValue}
- selectedValue is reference to object in backing bean having getter/setter.
Issues. - When execute=@form is added to ajax tag, listener is not even called. - After execute-@form, listener is getting called however radio button selected value is not updated in backing bean. - When i debug getter is always called for selectedValue never the setter.
Any help will be appreciated. Thanks.