I think we're talking about two different things: I was talking about trying to access the model of a parent component, it sounds like you're talking about trying to access the model of a superclass.

In the case I'm talking about, you can't access the inherited model in your constructor because your object hasn't been added to the parent component yet (it will be added after the constructor runs). Therefore you need to wait until onBeforeRender to do initialization that depends on inspecting the inherited model.

Hope that helps,
Alex

On Jul 31, 2008, at 5:39 PM, Daniel Freitas wrote:

I think I might be missing something here. I assume you don't create your components in the parent's constructor right? Or you call a different super constructor perhaps? Because java executes the parent constructor before
calling a subclass constructor and for what I've seen so far in the
examples, the components are usually created and added in the constructor, so you would have created your components and models before getting to the
subclass initialization.



2008/7/31 ZedroS <[EMAIL PROTECTED]>


hi

Sorry for the delay, holidays went in the way ;)



Alex Jacoby-2 wrote:

More than once I've tried accessing my inherited model from within a
constructor, forgetting that since the component hasn't been added yet
it can't access its inherited model there.

That's not your problem, right?

Alex



hum, Alex, thanks a lot !! It's something I hadn't figured out by myself
and
most probably stuck my head against more than once without even realizing
it
! Thanks a lot (and shame on me) ! It would be nice for it to be included
in
the Working with Wicket models wiki page for people like me...

I'll definitely makes more tries of it, since I'm not sure I properly get how compound property models are shared among inheritors. And the day I'm
sure of it, I'll update the wiki page if noone has done it before me.

++
zedros
--
View this message in context:
http://www.nabble.com/Direclty-using-parent%27s-compoundpropertymodel-not-possible---tp18356056p18763687.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to