struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mailtolouis2020-str...@yahoo.com
Subject Re: How to set Array properties?
Date Mon, 27 Jul 2009 17:05:36 GMT
Thank You!



________________________________
From: Musachy Barroso <musachy@gmail.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Monday, July 27, 2009 5:58:02 PM
Subject: Re: How to set Array properties?

<s:iterator status="status" value="users">
   <s:checkbox name="userId" value="%{selectedUserId}" fieldValue="%{userId}"/>
   <s:textfield label="First Name" name="users[%{#status.index}].firstName" />
   <s:textfield label="Last name" name="users[%{#status.index}].lastName" />
</s:iterator >

On Mon, Jul 27, 2009 at 7:55 AM, Louis Voo<jlvoo@yahoo.com> wrote:
> Hi,
>
> For e.g, I've this iteration in my jsp page
>
> <s:iterator  value="users">
> <s:checkbox name="userId" value="%{selectedUserId}" fieldValue="%{userId}"/>
> <s:textfield label="First Name" name="firstName" />
>    <s:textfield label="Last name" name="lastName" />
> </s:iterator >
>
> and this in action
>
> public User[] getUsers(){
> return this.users;
> }
>
> public User[] setUsers(){
> return this.users;
> }
>
>
> When the user submit the form, I want struts set the firstName & lastName back to
users array, how to achieve this?
>
>
> Regards
> Louis



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message