You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bhaarat Sharma <bh...@gmail.com> on 2008/01/17 22:16:33 UTC
how do to this in S2
Hi,
I\'m new to struts2. we\'r wondering how this can be achieved in S2.
initially we are getting a list from the action class. this list
contains bunch of objects and each object contains bunch of
attributes. In the JSP we iterate over this list and for each Object
we create a row. We populate the row\'s columns with current Objects
attributes. But some fields in the row are text fields.
Now when the user clicks submit, we would like to get back the data
that the user entered. So we have multiple rows and each row has a
text field. [think a 2 dim array].
It would be Ideal for us that when the user clicks submit. we
repopulate the list with data that is already there + data user
entered. So the text fields in each row would match the \'setter\'
for that object.
Hopefully I did a decent job in explaining this but if not please ask Q\'s
thanks for all the support!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how do to this in S2
Posted by Laurie Harper <la...@holoweb.net>.
bhaarat Sharma wrote:
> Hi,
>
> I\'m new to struts2. we\'r wondering how this can be achieved in S2.
>
> initially we are getting a list from the action class. this list
> contains bunch of objects and each object contains bunch of
> attributes. In the JSP we iterate over this list and for each Object
> we create a row. We populate the row\'s columns with current Objects
> attributes. But some fields in the row are text fields.
>
> Now when the user clicks submit, we would like to get back the data
> that the user entered. So we have multiple rows and each row has a
> text field. [think a 2 dim array].
>
> It would be Ideal for us that when the user clicks submit. we
> repopulate the list with data that is already there + data user
> entered. So the text fields in each row would match the \'setter\'
> for that object.
>
> Hopefully I did a decent job in explaining this but if not please ask Q\'s
Have you tried it? Provided your action has the appropriate getters and
setters and your JSPs correctly relate the input tags to the action
property, it should just work. If you're still unsure how to proceed,
post more details of exactly what your data structure looks like and
what you tried in the JSP - make sure to include the s:textfield tag
you're using and the surrounding s:iterator tag in your sample code.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org