MY PROBLEM: myItem throws NullPointerException. Idx is just the index of the row in the table not an IdItem. I don’t know how it sets the id… because when I fill up I don’t determine that.
Long story short, HOW CAN I GET MY ITEM (or row info)?
but it throws a cast exception…
com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.ClassCastException: java.util.Collections$UnmodifiableSet cannot be cast to java.lang.Integer
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
If you want to listen to a click on a row you should implement ItemClickListener.
The ItemClickEvent then gives you the itemId for the row you clicked on.
Otherwise you have to make the table selectable.
PS: I’m a little confused about your usage of two different containers (except p and ic are the same).
As stated in the javadoc for setValue() in AbstractSelect (superclass of Table) and in a few other locations:
If the Table is in multi-select mode, its getValue() returns a Set of item identifiers, and setValue() should be given a Set of item identifiers.
If the table is in single select mode, its value is an item identifier - which can of course be null if nothing is selected.
You then need to map from the item identifier to the item using getItem().
If you want to e.g. get a property value, you could also use directly something like (typed from memory, not tested):