Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Initialize OptionGroup with multiple values
Hello,
There is a demo for option group with cities at http://demo.vaadin.com/sampler#OptionGroups. If other two cities (e.g. Oslo, Paris) are also initialized, how to write the code?
Thanks,
Watt
I havent tried this, by have you tried setValue(myCollection) where myCollection is for example an ArrayList?
Danny Roest: I havent tried this, by have you tried setValue(myCollection) where myCollection is for example an ArrayList?
Another option is to say select for each itemId to be selected:
optionGroup.select(BerlinItemId);
optionGroup.select(OsloItemId);
optionGroup.select(ParisItemId);
Thanks! both Danny and Henri are correct.