The component SubmitNotifier is the solution.

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/SubmitNotifier.html

Put this component inside a form. When the form is submited the component
will fire two events for every iteration of your loop.
Handle the event AfterSubmit to get the value of the current field of the
iteration.

See examples:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml?view=markup
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java?view=markup

On Tue, Dec 16, 2008 at 7:12 PM, Eric Ma <eric...@db.com> wrote:

>
> Forgive me if this question has been asked a million and one times.  Coming
> from a Struts background, one of the feature I find useful over there is
> the
> easiness for handling a non-fixed number of form fields that are rendered
> through a loop, using the "indexed properties" approach.  What is the
> equivalent approach in T5?  I think I know how to render an array of
> textboxes using <t:loop> in the .tml.  But how do I declare a List or an
> array in the .java class?  Is T5 smart enough to populate the list/array
> upon form post from the textboxes, and set textbox values from the
> array/List on a page render request?  Can someone give me a pointer to some
> sample code?
>
> Thanks,
> --
> View this message in context:
> http://www.nabble.com/-T5--How-to-handle-a-variable-number-of-input-fields-in-a-form-tp21038549p21038549.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Reply via email to