Hm. Given what Igor said, I could come up with a different patch that
delays the entire onInitialize thing instead of creating the new
onPageInitialize event.

I don't understand what you mean by "a useless hotspot". onInitialize
doesn't get called recursively on parent components, only on super
classes.

Currently the contract of onInitialize is that it is called at some
point before onConfigure/onBeforeRender. The main use case I see for it is to 
do things that require the page hierarchy *and/or* that
depend on the constructors having run completely. So I think Page's
onInitialize should not be final, but rather that as Igor said, the
whole initialization step could be done before onConfigure. It's past
1AM now already, but I'll provide a patch for this tomorrow so you can
have a look.

Carl-Eric
www.wicketbuch.de

On Thu, 2 Dec 2010 17:07:10 -0200
Pedro Santos <pedros...@gmail.com> wrote:

> yes, delaying onInitialize until the constructor ends for pages isn't
> the goal.
> 
> On Thu, Dec 2, 2010 at 5:03 PM, Pedro Santos <pedros...@gmail.com>
> wrote:
> 
> > Page will always be the root node at the components tree, we don't
> > need an useless hotspot on the framework, that is why I think the
> > page should have an final onInitialize.
> >
> >
> > On Thu, Dec 2, 2010 at 4:53 PM, Igor Vaynberg
> > <igor.vaynb...@gmail.com>wrote:
> >
> >> No. the contract is that the parent is initialized before the
> >> children.
> >>
> >> Initialization of the entire hierarchy can be delayed until right
> >> before configure is called.
> >>
> >> Igor
> >>
> >> On Dec 2, 2010 10:00 AM, "Carl-Eric Menzel" <cmen...@wicketbuch.de>
> >> wrote:
> >>
> >> Okay, I decided should just go ahead and put my money where my
> >> mouth is :)
> >>
> >> Delaying onInitialize for pages isn't really feasible, I think. So
> >> I created a patch that would make onInitialize final in Page (as
> >> Pedro said) and introduces a new event onPageInitialize that is
> >> only called on pages. It honors the same contract as onInitialize,
> >> i.e. it is called only once per page object, at some point before
> >> onBeforeRender.
> >>
> >> See https://issues.apache.org/jira/browse/WICKET-3218 for details.
> >>
> >>
> >> Carl-Eric
> >> www.wicketbuch.de
> >> On Thu, 2 Dec 2010 13:50:30 +0100
> >>
> >> Carl-Eric Menzel <cmen...@wicketbuch.de> wrote:
> >>
> >> >
> >>
> >> > > Make onInitialize final on pages is an good idea. It is
> >> > > designed to children have a guaranty...
> >>
> >
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
> 
> 
> 

Reply via email to