Thank You!


________________________________
From: Musachy Barroso <musa...@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<jl...@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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to