struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Almeida <mig...@almeida.at>
Subject How to set the name parameter on a multiple s:select
Date Wed, 29 May 2013 10:27:35 GMT
Dear all,

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"/>


Thank you for your help!

Miguel Almeida


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message