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

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.

Hi,

Oops, sorry!

Thanks for your suggestion. Issue solved!

Regards,
Gerard