On Fri, Jun 19, 2009 at 5:49 AM, Piero Sartini<li...@pierosartini.de> wrote:
> I thought about that as well - and the problem with that solution is that my
> base class does not know about the activation context of its childs. Some
> pages need two parameters, some need only one - sometimes it is an ID of
> something, sometime it is the username. Its totally in the control of the page
> how they initialize themselve.

My solution cover everything you needed without the need for
subclasses to call initialize(). About some pages needing two
parameters, other two, this isn't a problem: just use EventContext as
the parameter of your onActivate(). Regardless of how many parameters
were used, it will be called. You can check the number of parameters
using EventContext.getCount() and get their values using
EventContext(Class desiredType, int index).

> For know I am calling initialize() in the onActivate(...) method of every
> page. But my feeling is that there should  be some framework provided
> initialization method that is called AFTER page activation.

There's no need for that.

> Is this still something that doesnt make sense to you? (just to be sure I am
> not on the completely wrong track).

It doesn't make any sense, because the solution I gave you solves all
your problems in an elegant way. Please try the solution.

-- 
Thiago

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

Reply via email to