Another option is to override onBeforeRender The problem is that the component is not added to the parent in the constructor yet:
add(new Foo()); First Foo constructor is called, then the add... In your case, having an explicit contract about the parent isn't too bad though. Gives an opportunity to document what happens when you add it to a different component. Martijn On 8/10/07, Will Jaynes <[EMAIL PROTECTED]> wrote: > Using 1.3. I have a panel which needs to create different internal > components depending on who it's parent is. However, calling getParent() > in the constructor gives me null. I can make a constuctor that passes in > the parent. But I wonder if there is a different way. Is there some > other point where I could call getParent(), get the parent, and then > construct the components for the panel? > > Will > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Wicket joins the Apache Software Foundation as Apache Wicket Apache Wicket 1.3.0-beta2 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
