If you really are calling getPage() in your panel's constructor than it can't work. Because at that point the panel is not added to page.
You can postpone your initialization by putting the code to onBeforeRender and invoke it only when onBeforeRender is called for the first time. e.g super.onBeforeRender(); if (!hasBeenRendered()) { // getPage() works here. Do the stuff you need with page instance } -Matej On Dec 27, 2007 7:46 AM, Artur W. <[EMAIL PROTECTED]> wrote: > > > Antoine Angénieux wrote: > > > > May be you should try making your panel abstract and override an > > abstract method as an anonymous inner class of your page, instead of all > > your "ifs" ? > > > > Antoine, Thanks for you reply. > > Your idea is good but it will not work in my case. > > I have a abstract page to which I add my Panel (menu). All of the other > pages extends this abstract page so I don't create/add this panel to them. > > > Best regards, > Artur > -- > View this message in context: > http://www.nabble.com/getPage%28%29-throws-IllegalStateException%3A-No-Page-found-for-component-tp14496019p14510157.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]