I have a dataTable which has a radio button in one of it's columns. I want to get the value of the radio button on the client side when one is clicked. I can't for the life of me figure out how to get the "itemValue" of the button that's been clicked:
<bjs:selectOneRadio behavior="visibleClick" id="itemActive" value="#{myLayer.active}" disabled="false">
<f:selectItem itemValue="item1" itemLabel=" " />
<f:selectItem itemValue="item2" itemLabel=" " />
</bjs:selectOneRadio>
<f:selectItem itemValue="item1" itemLabel=" " />
<f:selectItem itemValue="item2" itemLabel=" " />
</bjs:selectOneRadio>
This should be simple, shouldn't it? Whatever I try in the behavior "visibleClick", I can't grab the value of the button.
Any ideas?

Radio button
8 April, 2008 - 17:17 — andysHi dpoulet,
You can get the value of the radiobutton from the clientside. You can use this code
<s:behavior b:name="visibleClick">
<s:event b:on="command">
<s:variable b:name="local" b:select="//input" b:scope="local" />
<s:for-each b:target="$local">
<s:if b:test="$_target[@checked]">
<s:variable b:name="itemValue" b:select="substring-after($_target/@id, ';')"/>
<s:task b:action="alert" b:value="{$itemValue}"/>
<s:task b:action="alert" b:value="true"/>
</s:if>
</s:for-each>
</s:event>
</s:behavior>
</f:verbatim>
<bjs:selectOneRadio behavior="visibleClick" id="itemActive" disabled="false">
<f:selectItem itemValue="item1" itemLabel="item1" />
<f:selectItem itemValue="item2" itemLabel="item2" />
</bjs:selectOneRadio>
With this code, you can actually get the itemValue of selecteditem. But one thing come accross of my mind. Why do you use the bjs component if you want to get the value on the client side? Are you also gonna use this bjs component to handle server side synchronization?
Hope this helps,
Andys