Zero selected Items in an OptionGroup?

Hi, guys!

I am using the FlexibleOptionGroup add-on in multi-selection mode to arrange my checkboxes using a GridLayout what works fine.

Now I added a ValueChangeListener to my FlexibleOptionGroup, because I always want to get notified, if no checkbox (of about 30) is selected…

I found out that I can get a String object containing all selected items with a getValue() call to FlexibleOptionGroup object. The result is a String that looks like that (assuming checkboxes 1, 4, 5, 7 and 27 are selected: "[item1, item4, item5, item7, item25]
" (braces included). If there’s no item selected, the String looks like “”.

I need something like “If there’s no checkbox selected at the moment, make another component invisible”. The invisibility part is not the problem, but to find out, if there’s something selected or not…

Do you have a tip for me?

Thanks in advance

I’m sorry, I gave an answer to myself and did not realize it… :rolleyes:

That’s exactly, what my listener method now implements and it works:

				.addValueChangeListener(new Property.ValueChangeListener() {

					public void valueChange(ValueChangeEvent event) {
if (!categoriesOptionGroup.getValue().toString()
						} else {