How to detect which radio button was clicked in h:selectOneRadio using javascript or maybe jquery?
I can already do this using valueChangeListener and a4j:support from managed bean.
What i want is not to go to the server and just use jquery just for performance, because sometimes
it takes time before the server response comes back.
What i want is when a radio button was clicked it will disable some of my components.
Here is the code.
<h:selectOneRadio id="isPrivate" valueChangeListener="#{someBean.changeRadio}">
<a4j:support event="onchange" reRender="sp" />
<f:selectItem id="isPrivate0" itemLabel="No" itemValue="false"/>
<f:selectItem id="isPrivate1" itemLabel="Yes" itemValue="true"/>
</h:selectOneRadio>
Thanks in advanced.
🙂
It’d better attach change event to each radio button in the list on document’s onload.