Navigation in table - Selection vs row focus

I am trying to improve the support for keyboard navigation in my application, and currently I’m looking at how I can navigate in lists.

Vaadin supports arrow up/down navigation in lists, but there are two problems with that;

  1. I have to implement my own version of navigation for editable lists
  2. This navigation sets the selection of the list, which triggers the valueChanged listeners.

I see that if I do table.focus() the first row in the table gets an outline around it, and I can move this outline with ctrl-up/down.
This fires no valueChanged event.
I can then press space, and the row gets selected.

This seems more like the behaviour I would like, but there are still two problems with this:

  1. I would like this to happen on regular arrow up/down instead of ctrl-arrow up/down
  2. If the list supports multi-select, pressing space toggles the selection of the current row and doesn’t deselect the others (I would have expected space to set selection and ctrl-space to toggle)

Anyone know if there is a way I can influence this behaviour?

Hi,

unfortunately this functionality seems to be quite deep in the client-side VScrollTable class, which isn’t known for its great extensibility. If you want to take a look at it, com.vaadin.client.ui.VScrollTable.handleNavigation(int, boolean, boolean) would probably be a good starting point.

-tepi