On Mon, 28 Jan 2013 10:26:40 -0200, SlimerDude
<steve.ey...@alienfactory.co.uk> wrote:
Do you think it's possible for Tapestry to automatically know
whether an Index page takes a context or not?
I added a TransformWorker which checks if the page has a
"model.handlesEvent(EventConstants.ACTIVATE)", if it does then I assume
the context is being handled and I leave it alone.
Damn, I didn't know about the handlesEvent() method. Good catch, Steve! :)
I've learned something new about Tapestry and I loved it! :)
Steve, do you apply this worker for all pages or just ones named Index? I
think it could be applied to all pages.
If not, I add my own onActivate handler. It doesn't handle the case
where a mixin adds an
onActivate method though.
With proper ordering in the worker contributions (this one after the mixin
worker) I think your solution would work even in the case above. The only
think your solution wouldn't handle well is when there's an onActivate()
method without parameters just used for initialization stuff, something
quite common. Anyway, that's something I'd like to see integrated into
Tapestry, even if it leaves a case uncovered. But then, for this uncovered
case, an @NoPageContext annotation (which would also be useful in
non-index pages) annotation and its worker could be created. With both
solutions above, I think we cover all cases. What do you guys think? M
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org