It depends on how you have configured the checkbox to select the item within the datatable. I have used two different approaches. In the first, the checkbox is bound to a UISelectBoolean instance in the backing bean, like this:
The backing bean method would iterate through the elements of the datatable, and the UISelectBoolean instance would be set when you hit a row that is selected:
Frankly, this is not intuitive to many people...the value of the instance changes dynamically (because it is bound) as you iterate through the values in the datatable data. The second approach is the connect the checkbox to an boolean value of the backing bean. You have to get the entire row of data in a bean, then look at the value of that data member. Here is the declaratiion of the checkbox:
And here is the code within the backing bean:
Sorry for the lengthy reply...I hope this helps.
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss