Dave Newton wrote:
--- bradharris <[EMAIL PROTECTED]> wrote:
Any Response to this question?  I'm really hoping this wasn't left out of
Struts2, but I can't seem to find anything indicating there is support for
iterative form fields.  This is a pretty big piece to be missing, so
feedback on the correct approach here would be appreciated.

There is [currently] no automagic support for indexed form fields.
Constructing the names, however, is pretty straight-forward. It's not really
that "big of a piece" IMO, but it is a minor irritation. File a JIRA if
you're concerned (I don't know if there is one already).

To be clear, the part that is missing is automatically generating the names of the input fields appropriately. You can certainly still use collection-backed form fields, you just need a little extra coding in your JSP. Something like this:

    <s:textfield id="name[%{#stat.index}]" name="firstname" label="...">

or

    <s:textfield name="names[%{#stat.index}].firstname" label="...">

(I'm not sure off the top of my head which is right, but it'll be something along those lines...)

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to