Guru
Guru

Reputation: 1

how to get data from HTMLDataTable in jsf?

<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?

Upvotes: 0

Views: 2708

Answers (2)

Bozho
Bozho

Reputation: 597026

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

Upvotes: 0

BalusC
BalusC

Reputation: 1108632

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.

Upvotes: 1

Related Questions