Hi,
I am new for vaadin. I want to create multi checkbox and set id to get id for use. how to create it?
thank you.
PS. I am not good in english language, I so sorry.
Hi,
I am new for vaadin. I want to create multi checkbox and set id to get id for use. how to create it?
thank you.
PS. I am not good in english language, I so sorry.
Do you mean something like this?
List<String> source = Arrays.asList(new String[] {"Item1", "tem2", "tem3", "tem4" });
OptionGroup opGroup = new OptionGroup("I can handle multi select!", source);
opGroup.setImmediate(true);
opGroup.setMultiSelect(true);
opGroup.select("Item1");
opGroup.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
getWindow().showNotification("Your selected items,"+
"displayed as String: " + event.getProperty());
}
});
You can add specific item (your own objects) to this opGroup, too.
Person person = new Person();
opGroup.addItem(person);
opGroup.setItemCaption(person, person.getName());
Now your person object is the ID and the name of your person is displayed.
Thank you so much. your something code is look like my code.