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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
How does getValue (ListSelect) work when in multiselect mode?
Hi,
I'm struggling with a ListSelect component in multiselect mode!
Setting multiple items using the setValue() gives no problems, but how to get the items using the getValue()?
I'm unable to loop over the items! I get a basic error like:
java.lang.ClassCastException: java.util.Collections$UnmodifiableSet cannot be cast to java.util.List
I must be missing some very basic issues here!
Regards,
Gerard
Last updated on
Hi,
Apparently, you are casting to a List. The component returns a Set, not a List. You should do something like:
Set value = (Set) listSelect.getValue();
Hope that helps.
Last updated on
Hi,
Oops, sorry!
Thanks for your suggestion. Issue solved!
Regards,
Gerard
Last updated on
You cannot reply to this thread.