struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Can struts do it / 2?
Date Fri, 21 Apr 2006 15:15:55 GMT
Marco Mistroni on 21/04/06 11:23, wrote:
> i cant manage to populate back to the Action class,.. since I will have an
> array of DTO that needs to be submitted from the page.
> 
> The crucial problem that I am having is mainly that within the
> logic:iterate, for each 'row' I need to create an input parameter that is
> associated to a property of type array[]
> 
> In pseudocode, it would be like this
> 
> <logic:iterate>
> ..   <html:checkbox property="x"/>
> </logic:iterate>
> 
> 
> And that should generate a checkbox for each row. 
> 
> I cannot manage how to do that... I m sure someone has already had this
> problem...

My usual approach is to find an example that I did before, as on Blue 
Peter, that kids show, but I don't have my old code library on me - 
there must be an example of how to use logic:iterate with checkboxes 
somewhere.

The key to working these things out from scratch is to check what the 
HTML looks like. The example above will just produce the same piece of 
HTML for the checkbox over and over. Doesn't the indexing attribute come 
into play here? The docs say "Valid only inside of logic:iterate tag. If 
true then name of the html tag will be rendered as 
"id[34].propertyName". Number in brackets will be generated for every 
iteration and taken from ancestor logic:iterate tag."

What HTML comes out when you do that?

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


Mime
View raw message