tags:

views:

274

answers:

2
<h:dataTable width="100%" border="1" cellspacing="0"
  cellpadding="2" style="border-collapse:collapse;display:block"
  styleClass="Header" value="#{adminBean.displayResults}"
  var="aResult" binding="#{adminBean.browseResultsHTMLDataTable}">

This is what i am trying to do. I have a dynamic list of data, which i try to display in the HTML Table format using h:dataTable (the bounded value is an arrayList). The table has got a radio button for each row it displays (boolean w/ h:selectOneRadio ) now when i select the radio button in one of these rows, i want to get the values of the row that is selected for which i try to use binding attribute. But i get Row Unavailable exception - is my approach wrong? any suggestions?

A: 

Selecting rows by radio button in a datatable is a tricky task since the radio buttons aren't grouped. Long story short: Select row by radio button.

BalusC
Thanks BalusC. You are popular in all JSF Forums :) Do you suggest any other way to solve this?- All I need is to get these dataTable data available at the Server side. Or can I just use Javascript to get these values and submit the form - but which method will be called since i cannot have a Servlet mapped using the "action" attribute of the form tag when i submit!!!
Guru
The Javascript is only there to unselect the other radiobuttons because they're not grouped. The linked article explains along with code examples how to obtain the selected item in the server side.
BalusC
A: 

I think you can use <t:selectOneRadio> with layout="spread" and then <t:radio> on each row.

Bozho