On Mon, 2008-11-10 at 14:31 +0000, Peter Stavrinides wrote: > The trouble is when multiple onActivate methods are required, it always requires a little more thought to get the page handling perfect. > Since this pattern gets repeated a lot, you often end up with hundreds of these onActivate > methods ...its a lot of boilerplate code that could be optimized.
I think i would agree with that. > >Maybe the best way to deal with different onActivate methods is to have a > >single one receiving an EventContext object > If it can be done this way then definitely a better solution IMHO, and less > error prone too... onActivate is not 'Tapestry simple' yet. > > What I like most about the onActivate event concept is that you can code > defensively, i.e.: the ability to return an object if you so choose. I find > this useful for instance when incorrect parameters are supplied to a page you > can simply return another page, instead of displaying an ugly error to the > end user. The trouble is when multiple onActivate methods are required, it > always requires a little more thought to get the page handling perfect. Since > this pattern gets repeated a lot, you often end up with hundreds of these > onActivate methods ...its a lot of boilerplate code that could be optimized. > > cheers, > Peter > > Em Sat, 08 Nov 2008 13:05:50 -0300, Joel Halbert <[EMAIL PROTECTED]> > escreveu: > > > I'd be interested to hear how others handle this, and what the merit of > > having all available onActivate methods > > invoked is when the full context is supplied. > > Maybe the best way to deal with different onActivate methods is to have a > single one receiving an EventContext object > http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/EventContext.html > > and then use its getCount() method to find out how many parameters were > passed in the activation context. > -- SU3 Analytics Ltd The Print House 18 Ashwin Street E8 3DL London Tel: +44 (0) 20 3051 8637 Fax: +44 (0) 20 8196 2215 Mob: +44 (0) 79 7431 0685 www.su3analytics.com SU3 Analytics Ltd is a company registered in England and Wales under company number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, United Kingdom.