Highlighting row in a single selection table



/**
* Method for highlighting row in a single selection table
* @param Key
*/
public static void SelectTableRow(Key key, RichTable table) {
if (table == null) {
return;
}
if (key == null) {
key = new Key(new Object[] { 0 });
}
RowKeySet rks = table.getSelectedRowKeys();
if (rks == null) {
rks = new RowKeySetImpl();
} else {
rks.removeAll();
}
List keyList = new ArrayList();
keyList.add(key);
rks.add(keyList);
table.setSelectedRowKeys(rks);
}

No comments:

Post a Comment