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
12224.png

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.