Can s:select multiple have a object.someList as name?

View: New views
1 Messages — Rating Filter:   Alert me  

Can s:select multiple have a object.someList as name?

by wild_oscar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I am trying to pass the multple selected items on a s:select onto a List<Serious> that I have on an "some" object:

Some{
List<Serious> seriousness; ...}

I am using spring to inject "some" in my action:
<bean id="some" scope="prototype"
                class="package.SomeClass">
        </bean>

Using a:
<s:select multiple="true" value="%{#some.seriousness.{id}}"  multiple="true" name="some.seriousness.id"  list="activeIngredients" listKey="id" listValue="name" />

I'm facing an issue: the some.seriousness is being injected with multiple Serious objects, with some repetitions of selected elements.  If I select 2 elements, I'll get a list with size 4 (2x each one), sometimes more.

I've also tried with name="some.seriousness", but this one goes directly to input result (indicating an error in populating the fields).

Note that if name="seriousList" and I can successfully see selected items if I declare an Integer[] in the action:

Integer[] seriousList;

Does anyone know how to successfully inject the selected values onto the object's list.