struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rodriguez Lopez <alo...@flordeutopia.pt>
Subject Re: set a list from getmodel()
Date Thu, 01 Jul 2010 08:57:55 GMT
As far as I remember, for Struts to populate a list you just give the 
same name for a setter in the action that takes a List<> as a parameter 
as the element(s) in the Jsp. So you can have 10000 textboxes *with same 
name*, and if this name happens to map to a list, the list will get 
populated with each of the elements with the same name.

For the dinamic thing, you could use javascript to accomplish that.


> Dear List members,
>
> More over I don;t know how many address will the user enter, it can 0 or
> 100000, need to generate jsp code dynamically
>
> Address [+]
>
> How are we going to achieve this type of functionality.
>
> What are best practices in setting multiple values of same object from FORM
> or how to set multiple objects of same type from FORMS.
>
> Help needed and appreciated.
>
> Regards,
>
> Amol Ghotankar.
>
> On Thu, Jul 1, 2010 at 1:03 PM, Amol Ghotankar<ghotankarua50@gmail.com>wrote:
>
>> Dear List memeber,
>>
>> I have a urgent requirement in which I will have  to populate a list or set
>> and this set / list will be getModel() for an struts action.
>>
>> How to write jsp code so that the set is populated directly here.
>>
>> Like say I have a list of address and from form
>>
>> address 1
>> address 2
>> address 3
>>
>> is submitted
>>
>> and it goes directly into set which is part of user.addres
>>
>> user object is having set of address.
>>
>> What should be done on jsp so that when action is called this set is
>> automatically populated.
>>
>

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


Mime
View raw message