On Mon, Jan 28, 2013 at 1:50 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote:
>> 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. That is very similar to the path I've envisioned and of course it has to be applied to all pages... Index are not special at all IMHO. > 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 > > The onActivate() method simply tell us that the page doesn't need an event context (no parameters) so it fall under the previous case, page without event context. There are hops you've to jump around on this scenario (EventContext, Object[] and Lists paramters to onActivate) but that still preferable then the current behavior. -- Massimo