问题
In my JSF 2.0(MyFaces 2.1.10, Trinidad 2.1.0 Version)Application, I need to use tr:selectbooleanradio in my page to achieve the functionality that my page requires.
In the below code, the default values of todaySelected and tomorrowSelected are 'false'. The issue is, once page loads, when I select 'today', the valueChangeToday is not getting called.(I believe it should call as default value of todaySelected is false and submitted value is true). When I select tomorrow, valueChangeToday is getting called and valueChangeTomorrow is not getting called. Likewise, things are happening only after the next selection, which makes my entire functionality working reversely.
I believe in both the cases, the submitted value is not going in correctly. But I couldn't understand why?!
FYI -tr:selectOneRadio is working perfectly, but I rely on booleanRadio.
The scope of the page bean is View(though I believe it's not a problem and request scope is performing similiarly). I'd appreciate any suggestions to resolve this issue or core component alternatives for this issue.
<tr:selectBooleanRadio group="groupDays"
selected="#{displayoverrideamountbean.todaySelected}"
id="todayRadio" text="Today"
valueChangeListener="#{displayoverrideamountbean.valueChangeToday}"
autoSubmit="true">
</tr:selectBooleanRadio>
<tr:selectBooleanRadio group="groupDays"
selected="#{displayoverrideamountbean.tomorrowSelected}"
id="tomorrowRadio" text="Tomorrow"
valueChangeListener="#{displayoverrideamountbean.valueChangeTomorrow}"
autoSubmit="true">
</tr:selectBooleanRadio>
来源:https://stackoverflow.com/questions/33691594/clicking-text-in-trselectbooleanradio-not-generating-valuechangeevent