Hi,
Daniel, I did it in the same way, as u said.
I have an array bean which is bound to the datatable. The array contains many custom objects (of the same type). The custom object contains a field to hold to checkbox value, which is bound to the checkbox.
The command button has the following code:
FacesContext facesContext = FacesContext.getCurrentInstance();
UIViewRoot root = facesContext.getViewRoot();
UIData table = (UIData)root.findComponent("codeform").findComponent("table");
int x = table.getRows();
System.out.println("No of Rows:: " + x);
I thought of iterating the table rows and find out which has been selected. The problem is, it always zero for the value of x.
Its due to the fact, that the array bean which contains the command button's code is also initialized, which gets rid of all the values in the ArrayListBean.
Please let me know how to solve this. (OR) Daniel can u provide me your code, so that i try with yours.
Thanks
Akbar