Id's of more than one row selected in Vaadin table

If i am selecting 2 or more rows in a vaadin table(multiselect mode), how to get all the item id’s for the selected rows. If it is not in multiselect mode we can get it by using table.getValue(). Is there any method to get more than one id’s?

Also getValue() method returns id’s in multiselect mode as an object like [90,36,23,etc]
. I am not able to iterate this.

Could you please help me on this?

Can’t you iterate over it like this: Object [] selected = table.getValue(); for(int i = 0; i<selected.length();i++){ System.out.println(selected[ i ] ); }
?

In multiselect mode, Table.getValue() returns a java.util.Set. You may safely cast the return value to Set, then do whatever you wish with it.

Hi Marius… table.getValue retuns an Object not an Object Array. So can’t iterate like this.

Are you sure, because [90,36,23,etc]
sounds more like it’s a Object-Array or in fact a Set. Try casting the result of getValue() to one and then try iterating over it.

Hi Johannes. It worked. Thanks very much…

getValue() in multiselect mode returns a Set. It Worked.