How to bind checkbox to a boolean parameter?


List<String> items = Arrays.asList(new String[]{"idem1", "item2", "item3"});
checkboxes = new OptionGroup("Show delete confirm dialog for", items);
checkboxes.setMultiSelect(true);
checkboxes.setImmediate(true);

How can I bind the value of the checkbox directly to another (boolean) list?
On ValueChangeEvent, I’d like to know which items have exactly been selected. How can I find out if item1 is selected, and item2 and item3 not?

If you use getValue in MultiSelect mode you get a Set of itemIds in return so for your case described last you could do something like this: Set set = (Set) checkboxes.getValue(); if(set.contains("idem1")&&!set.contains("item2")&&!set.contains("item3")){ //Because in your code it's called idem1 //idem1 is selected but item2 and item3 isn't } Again you could’ve solved this question yourself just by looking at the Javadoc.