Problem in getting selectOneRadio value placed in dataTable

I want to get Id bind with selected radio button, whn radio button is selected, the value of backing bean should be set.

But the problem me facing is, If I check last radio button I get the value and if I get rest of radio buttons my bean value didnt set. Why it happen that only last radio button of data table row works fine.

I hope I u ppl help me

<h:dataTable value="#{depositMoneyPageBean.allCreditCardsOfUser}" var="creditCardData"

>

<h:column>

<f:facet name="header">

<f:verbatim>...</f:verbatim>

</f:facet>

<h:selectOneRadio id="selectRadio" value="# {depositMoneyPageBean.selectedCreditCardId}" onclick="selectOne(this.form , this)" >

<f:selectItem itemValue="#{creditCardData.cardId}" /> </h:selectOneRadio>

</h:column>

<h:column>

<f:facet name="header">

<f:verbatim>Payment Method</f:verbatim>

</f:facet>

<h:outputText value="#{creditCardData.cardTypeName}" styleClass="tLabel" />

</h:column>

</h:dataTable>

[1393 byte] By [tahirakrama] at [2007-10-3 9:48:29]
# 1
issue resolved. solution: http://itoday.wordpress.com/2007/04/08/accessing-a-selected-row-from-hdatatable/
tahirakrama at 2007-7-15 5:05:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Here is a comparable solution: http://balusc.xs4all.nl/srv/dev-jep-dat.html#SelectRowByRadioButton

With a much better Javascript solution, it only clears out the involved radiobuttons, not the other radiobuttons in the same form, which can be dangerous if you've another radiobuttons for other purposes.

BalusCa at 2007-7-15 5:05:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...