Hii all
I am not able to select-all or unselect-all rows in scrollabledatatable??Is there any ways to do it ,like selecting all rows by clicking on a button??
best regards
Jayaraj
hi,
i have some problem in getting the selected row in scrollableDataTable.
<rich:scrollableDataTable value="#{seamtablebean.userList}" var="user" id="list" binding="#{seamtablebean.dataUiData}" rows="5" height="100px" selection="#{seamtablebean.selection}" rowKeyVar="rkv" frozenColCount="1" sortMode="single">
</rich:scrollableDataTable>
This is my code i have written in XHTML file.
and:
private SimpleSelection selection = new SimpleSelection();
HtmlScrollableDataTable dataUiData;
i have proper setter and getter method for this.
userList = listofelements.getAlerts();
dataUiData.setSortMode("single");
dataUiData.setSelection(getSelection());
dataUiData.setValue(userList);
dataUiData.setHeight("100px");
dataUiData.setRows(5);
Iterator keys = dataUiData.getSelection().getKeys();
while(keys.hasNext())
{
Object key = keys.next();
dataUiData.setRowKey(key);
}
This code fills the table.
Now i not getting selected row from the table. i always get null for
Iterator iterator = getSelection().getKeys();
so pls anybody suggest where am i going wrong.
Thanks in advance
Regards
Devika.N
use this code
where GR_KUN_7130 is the binding variable for scrollabledatatable
HtmlScrollableDataTable GR_KUN_7130; which must be given in the binded attribute in xhtml code for table
GR_KUN_7130_TableBean is the table bean
Iterator iterator = getSelection().getKeys();
while (iterator.hasNext()) {
Integer key = (Integer) iterator.next();
GR_KUN_7130.setRowKey(key);
GR_KUN_7130_TableBean obj =(GR_KUN_7130_TableBean)GR_KUN_7130.getRowData();
int indx = GR_KUN_7130_List.indexOf(obj);
// idx is the selected row number
}
check richfaces-demo sources. extended and scrollable table samples has this implemented. http://www.jboss.org/richfaces/demos.html