> It bubbles up in the ancestor chain until the callback passed to the
> triggerEvent method says the event was handled.

Ah, missed that somehow. That helps returning multiple Zones but
leaves the ancestor problem.

>> Can you be more specific what I should pay attention for? Isn't
>> validation done when the page is fully rendered?
>
> No. It is done when the form is submitted (which is an event too). The form
> fields store commands in an object in the Environment that is put in a
> hidden field by Form. Later, when the form is submitted, Form executes these
> commands.

OK, went through it and I am not sure if I got everything, as there
are quite some concepts in it I am not very familiar with.

However I give it a try and transfer the logic to my situation:  You
propose to store an environment object in the page/component close to
the root and let all
components register there (e.g. in a map where the keys are events
they are interested in) during page rendering.
This map is then serialized and stored.
Later when the event is triggered the very first event handler looks
up that map, gets all registered components for that event and asks
them to
respond to that event?

Mhm, basically I build my own event bus. Shouldn't be necessary. But
maybe I am too blinded by my event approach and you meant something
different?

I also have thought about your performance argument. I doubt that this
is a huge problem. Tapestry has a static page structure. Therefore it
should be possible to go through all the components during page
construction
and register them for the events they listen on in an internal map on
page level. When a global event is fired, the registered components
can be simply looked up and notified. Virtually no performance impact.
Sounds rather simple. But ok, might not be the tapestry way of doing
things.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to