Hi,
My grid uses "columnSelectRow" feature to allow selection of rows.
How can I set a row in grid as selected when an input column in the row is edited ?
Regards
I would suggest that you use the following code in your selection change listener method:
public void onChangeSelection(SelectedRowsChangeEvent e) {
...
grid.dataBind();
Iterator rowsOnPage = grid.getRows().iterator();
RowItem item = (RowItem) rowsOnPage.next();
item.setSelected(true);
}
I hope this will work.
Regards!
I now noticed that you want the selection to be performed when you change the value of an input field in the column. In that case I suppose you should use the valueChangeListener="#{selectRowBean.onCellEdit}" attribute of the <h:inputText> tag. One implementation of the value change listener method could be:
In Java:
RowItem rowItem = (RowItem) e.getComponent().getParent().getParent();