I working on some improvements to tapestry.js right now. Mostly, this is about properly supporting the tapx/Confirm mixin, which intercepts clicks on Submit and LinkSubmit components so as to ask the user if they are sure.
What I've found is that because Prototype doesn't support a definite ordering of multiple listeners to the same event (*) I've introduced a pattern: The "click" event is canceled, and a replacement event "tapestry:action" is fired. Real work is done in the "tapestry:action" listener. This allows tapx/Confirm to stop observing the "click" event and replace it with its own "click" event listener that can, when confirmed, fire the "tapestry:action" event to get the real work (submitting the form, Ajax update, whatever) done. It's coming out pretty nicely and represents a kind of halfway point between the older, more primitive JavaScript in tapestry.js (back from 2005, 2006) and more modern approaches (such as the ExtJS way, which is to have a parallel hiearchy of controller objects that can also be referenced by id). (*) Also, if one event listener stops the event, orther event listeners on the same element will still get invoked, the event simply won't bubble up higher in the DOM. -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
