order of selection

To illustrate my problem, go to

      http://demo.vaadin.com/sampler#TableHeaderIcons 

when you stat clicking from the first row, when u get to the fourth , the ordering become messed up.
You see " Selected: [AS, AF, AL, DZ]
" instead of [AF, AL, DZ, AS]
.

Any way around this?

Thanks.

BTW,
I was thinking probably an HashSet was used for the implementation instead of a LinkedHashset that can guarantee order ( http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedHashSet.html ), but I don’t know where to look.

Did I mention vaadin is great?

You’re right, a HasSet is used at least in AbstractSelect.You could probably write a ticket about this at
http://dev.vaadin.com

Hi,

Yeah, you’re right - the Selects do not guarantee that the selected id:s are kept in order, and HashSet is indeed used to store the selection. It’s possible that the selection would be kept in order in most cases just by switching to LinkedHashSet, but it’s not designed that way, so there might be some complications (the client-side could mess up the order in non-immediate mode, for instance)…

You could overcome this issue by keeping track of the order yourself, or by extending Table and modifying
changeVariables()
to suit your needs.

Best Regards,
Marc

Good to know.
Thanks for the swift response.