Get selected row id (index) from table


Is there a method to get the id or index of the selected row in a table?
I would like to numbering each row in a table and then get this number when a row is selected.
This is not a problem, i can just add a column whit this numbers…
But if you resort the table the number 1 must be on the top of the table again. Okay, again it is possible with a change listener and then renumber the table.

My question is, is there an easier way to get the id of the selected row? Something like the .size() method?


Hi Marcel!

Items (rows) are numerated in a Table. The way to take that:

Object rowId = table.getValue();

Also you can check that,

Maybe is too late, but I hope you find it helpful.