Hi,

thought I'd post my experiences with a form with multiple components in a loop.

My initial (preferred) solution was to have a single form with a
series of components in a loop. As far as I can tell this is simply
not possible with Tapestry at the moment. What can be done is:

1. Inject FormSupport into the components and register a handler. This
can be used to register a handler with storeAndExecute that makes it
possible to do the equivalent of onPrepare.
2. All validation events will bubble up to the component, so you will
get a validation event per form field - not particularly useful I
found.
3. You do not receive any events with which to manipulate the form
data after a submit, so all values need to be written into data
structures that are accessible from the containing page class.
4. The Grid rows class in the tapestry source code is a useful place
to look for FormSupport use.

After spending a lot of time on this I gave up and re-did the page
with every component in its own form. Then all the great T5 form
support kicks in and it is easy to deal with data and state.
Unfortunately this requires the user to save every form separately -
ideally AJAX should take care of that automatically. Unfortunately
there are two separate problems with dealing with zones in a loop (See
https://issues.apache.org/jira/browse/TAPESTRY-2360 and
https://issues.apache.org/jira/browse/TAPESTRY-2324) so it is not
currently possible to use zones.

T5 is fantastic and really easy to use, but this area still seems very
unfinished.

Adriaan

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

Reply via email to