I have a jsf datatable which has 8 columns. I need to fetch a row completely when the check box corresponding to that row is checked. In the backing bean an object corresponding to a row is created. How can I get the object ID of the row which is checked ?
Appreciate your help for the same.
posted 8 years ago
Hi there Silson,
There are a couple of ways of doing this. Here is one.
In your dataTable component on your page, bind it to an HtmlDataTable attribute of your Bean. Then when the user selects a row, fire an action event by way of a commanLink or button. And in your bean ask the HtmlDataTable which row by calling HtmlDataTable.getRowData(). This will the return an instance of the row that was clicked.