Reputation: 1
I have a piece of jspx code in which I want to render(make it visible) a selectOneRadio component conditionally on checking the selectBooleanCheckbox. The first time when check the checkbox the selectOneRadio gets rendered. But when I uncheck , the radio buttons doesnt get invisible.
Im having a valueChangeListener
in the checkbox code to do this rendering. But this listener doesn't get fired when unchecking the checkbox.
<af:selectBooleanCheckbox
id="sbc2"
text="#{viewcontrollerBundle.CB_TYPE_VIDEO_CHAT}"
selected="#{row.videoChatEnabled}"
disabled="#{row.videoChatEnabled}"
valueChangeListener="#{pageFlowScope.servicesbean.ValueChangeListener}"
binding="#{pageFlowScope.servicesbean.videoChatBinding}"
autoSubmit="true"
/>
<af:selectOneRadio
id="videoDirection2"
visible="false"
value="#{bindings.videoDirection.inputValue}"
contentStyle="margin-left:0px"
immediate="true">
Does anyone know why this behaviour is prevalent?
Upvotes: 0
Views: 614
Reputation: 5256
What you are trying to do needs a partial refresh for render/un-render the element.
Here is the sample:
<af:panelGroup partialTriggers="checkid">
<af:commandButton text="moo" rendered="#{backing_1.check.value}"
partialTriggers="checkid"/>
</af:panelGroup>
<af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
label="Label 1"
binding="#{backing_1.check}" id="checkid"
autoSubmit="true"/>
The above example show/hide the button based on the checkbox. Note that the button is wrapped in a panel to aid in the partial refresh.
Referenced from: https://community.oracle.com/thread/629222?start=0&tstart=0
Upvotes: 1