How to listen for table row getting focus?

Hi again,

I’m doing my second effort in starting Vaadin today :). I found out, that I can listen for table row selections using:


Table productSelectionTable = productSelectionComposite.getProductSelectionTable();
productSelectionTable.addListener(addressInput);

where my addressInput implements an ItemClickListener. This works well for noticing a table row being clicked. But I can not find out how to accomplish the following:

  • When I change table row focus using the keyboard, no click event (of course its not clicked :wink: is fired.
  • When I do a productSelectionTable.select(something) the event is also not fired.

Unfortunately I do not find a “FocusListener” or something similar. How can I track any kind of selection, no matter if clicked, double clicked, programatically set or navigated to by keyboard?

Best regards,

Bergtroll

Hi,

You don’t really want a FocusListener - as it would only get notified when the Table gets the focus.

I suspect what you really want is the ValueChangeListener; this does precisely what you want - notifies you when the Value represented by the component changes, no matter what causes the change.

Cheers,

Charles.