0
votes

I am trying to programmatically change the "highlighted" item in my CellList, based on keyboard events in another control (a textbox). I can get the keyboard events just fine, but when I use CellList...

int row = getKeyboardSelectedRow() + 1;
setKeyboardSelected(row,selected,stealFocus)

It doesn't have any affect. If I put focus on my cellList indeed, I can move up and down and highlight a row. If I put true for "stealFocus" on the setKeyboardSelected() method, it "works", except I really want to keep focus on the textbox, rather than the cellList. How do I do this? I've attempted fireEvents, sending the keystrokes to the CellList, but that doesn't help either.

J

1
It looks like I need to render this myself ignoring the keyboard highlighting functionality. How would I highlight a particular row?Joel

1 Answers

0
votes

I have no immediate solution, but if I were you I'd step through the code of setKeyBoardSelected in com.google.gwt.user.cellview.client.AbstractCellTable in debug mode. Maybe this is where it's going wrong?

if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy()
|| !isRowWithinBounds(index) || columns.size() == 0) {
return;
}