I've also posted this on
http://stackoverflow.com/questions/16812357/how-to-set-the-name-parameter-on-a-multiple-sselect
so the knowledge can be shared once the answer is known.
I also plan to add this to struts' documentation!
Miguel
On Wed, 2013-05-29 at 11:27 +0100, Miguel Almeida wrote:
> Imagine you have the following scenario:
> - a property in your action: private Entity entity;
>
> - Entity has a List<Entity2> entity2List
> - Entity2 has a Entity3 entity3
>
> Now, you need an s:select with multiple="true" to populate entity3.
> This
> corresponds to having a request in the form
> entity.entity2List[n].entity3.id (n=0,1,2...depending on how many
> items
> are selected).
>
> Question: how should the name parameter of the s:select be like to
> achieve this?
>
> Me and Lukasz have tried the following without success (meaning
> entity.entity2List has is empty):
> <s:select key="centre.choose" multiple="true"
> name="%{entity.entity2List[].entity3.id}" list="#someList"
> listKey="id"
> listValue="code"/>
> <s:select key="centre.choose" multiple="true"
> name="entity.entity2List[].entity3.id" list="#someList" listKey="id"
> listValue="code"/>