SelectOneRadio inside extendedDataTable not working properly
jsfgeeks Dec 31, 2009 6:16 AMHi all,
I have a page with extendedDataTable in my application. In that table, I have a column with <h:selectOneRadio> inside that. Now what I want is, if there are multiple rows in a table, then the user can select only one radio button at a time (as it works generally). But in my case it is working like check box. I ca select any number of radio buttons (in fact all at a time). Here is my code for extendedDataTable,
<rich:extendedDataTable id="extdtable_cars" var="row"
binding="#{mybean.extdtable_cars}"
value="#{mybean.existing_car_list}"
style="left: 30px; top: 40px; position: absolute"
onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#FFFFFF'"
width="750px" height="200px"
enableContextMenu="false"
rowKeyVar="rkv" noDataLabel="No cars available" rows="0">
<f:facet name="header">
<h:outputText id="outtxt_existing_cars_header"
value="#{prassigngrp['pr.existingcars']}"
title=" #{prassigngrp['pr.existingcars']} "
style="font-size: 14px"/>
</f:facet>
<rich:column id="col_ap_row_num" width="25" style="font-size: 13px">
<f:facet name="header">
<h:outputText id="outtxt_ap_col_row_no_header" value="#"/>
</f:facet>
<h:outputText id="outtxt_ap_col_row_no" value="#{rkv+1}" />
</rich:column>
<rich:column id="col_ap_row_car_name" width="250" style="font-size: 13px">
<f:facet name="header">
<h:outputText value="Car Name"/>
</f:facet>
<h:outputText id="outtxt_car_name" value="#{row.car_name}"/>
</rich:column>
<rich:column id="col_ap_row_car_desc" width="350" style="font-size: 13px">
<f:facet name="header">
<h:outputText value="Car Description"/>
</f:facet>
<h:outputText id="outtxt_car_desc" value="#{row.car_desc}"/>
</rich:column>
<rich:column id="col_ap_row_car_sel" width="105" style="text-align: center">
<f:facet name="header">
<h:outputText value="Select Car"/>
</f:facet>
<rich:spacer height="1" width="30"/>
<h:selectOneRadio id="rb_sel_existing_car">
<f:selectItem/>
<a4j:support event="onchange"
action="#{mybean.value_change_existing_car}"/>
</h:selectOneRadio>
</rich:column>
</rich:extendedDataTable>
If there is something wrong then please let me know.
Thanks in advance,
JSF GEEKS