struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: Array Input Fields
Date Sat, 11 Sep 2010 15:24:55 GMT
It is, and it should be doing it automatically.

Can the OP post a minimal example showing the JSP and the action?

Dave

On Sat, Sep 11, 2010 at 11:22 AM, Burton Rhodes <burtonrhodes@gmail.com> wrote:
> I don't think Struts is that 'smart'. I would look into creating your
> own StrutsTypeConverter. Very easy to do and you can specifically
> manipulate  input variables from the form easily.
>
> On 9/10/10, adam pinder <apinder@hotmail.co.uk> wrote:
>>
>> Using Struts 2.0.11
>>
>>
>>
>> I have a jsp that creates elements like
>>
>>
>>
>>
>>
>> <input type="text" id="user[1].name" name="user[1].name" value="smith"
>> size="20" />
>>
>>
>>
>> etc....
>>
>>
>>
>> when the form is submitted to the server i want the parameters interceptor
>> to set the values on each user object so i have a method
>>
>>
>>
>> public User getUser(int occ)
>>
>> {
>>
>>     return users.get(occ);
>>
>> }
>>
>>
>>
>> which would return a user object. users is a List<User> object
>>
>>
>>
>> therefore i'd expect the params interceptor to make calls like
>> getUser(1).setName("smith") for the above input field sent to the server....
>> but it doesn't set the value or error - the params interceptor debug shows
>> the correct name/value pair of user[1].name => [smith]
>>
>>
>>
>> i have also tried with a string as the occ parameter but still no joy.
>>
>>
>>
>> anyone have any suggestions ?
>>
>>
>>
>> thanks
>>
>> adam
>>
>>
>>
>
> --
> Sent from my mobile device
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message