You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pieter claassen <pi...@claassen.co.uk> on 2009/02/13 15:14:04 UTC

How to get a reference to the holding page from a panel

Is there a simple answer for how to get a reference from a panel to the
holding page that is available at compile time (something other than
getPage() on beforeRender())?

Thanks,
Pieter

Re: How to get a reference to the holding page from a panel

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Fri, 13 Feb 2009, Warren Bell wrote:
> I have a simmilar situation where I want to put a panel nested in a 
> panel nested in a page. The panel that is nested in the page stays the 
> same for many different pages, but the panel nested into the panel 
> changes. Would you do an anonymous panel class within an anonymous panel 
> class within the page so that you can do the same type of referencing 
> MyPage.this? Or is there a better way of doing this?

It sounds like a design that could be improved if you need
a reference to the page. What are you trying to achieve?

Best wishes,
Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to get a reference to the holding page from a panel

Posted by Igor Vaynberg <ig...@gmail.com>.
he said he wanted a compile time reference. if you are ok with a
runtime reference, then getpage() will do.

-igor

On Fri, Feb 13, 2009 at 2:54 PM, Warren Bell <wa...@gmail.com> wrote:
> I have a simmilar situation where I want to put a panel nested in a panel
> nested in a page. The panel that is nested in the page stays the same for
> many different pages, but the panel nested into the panel changes. Would you
> do an anonymous panel class within an anonymous panel class within the page
> so that you can do the same type of referencing MyPage.this? Or is there a
> better way of doing this?
>>
>> Actually I also find that using getPage() on beforeRender() to get the
>> page
>> is ok as long as do deal with any problems in case you cannot get the
>> page.
>>
>> Pieter
>>
>> On Fri, Feb 13, 2009 at 6:34 PM, Igor Vaynberg
>> <ig...@gmail.com>wrote:
>>
>>> make the panel an anonymous or inner class of the page and use
>>> MyPage.this.
>>>
>>> -igor
>>>
>>> On Fri, Feb 13, 2009 at 6:14 AM, pieter claassen <pi...@claassen.co.uk>
>>> wrote:
>>>>
>>>> Is there a simple answer for how to get a reference from a panel to the
>>>> holding page that is available at compile time (something other than
>>>> getPage() on beforeRender())?
>>>>
>>>> Thanks,
>>>> Pieter
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to get a reference to the holding page from a panel

Posted by Warren Bell <wa...@gmail.com>.
I have a simmilar situation where I want to put a panel nested in a 
panel nested in a page. The panel that is nested in the page stays the 
same for many different pages, but the panel nested into the panel 
changes. Would you do an anonymous panel class within an anonymous panel 
class within the page so that you can do the same type of referencing 
MyPage.this? Or is there a better way of doing this?
> Actually I also find that using getPage() on beforeRender() to get the 
> page
> is ok as long as do deal with any problems in case you cannot get the 
> page.
>
> Pieter
>
> On Fri, Feb 13, 2009 at 6:34 PM, Igor Vaynberg 
> <ig...@gmail.com>wrote:
>
>> make the panel an anonymous or inner class of the page and use 
>> MyPage.this.
>>
>> -igor
>>
>> On Fri, Feb 13, 2009 at 6:14 AM, pieter claassen <pi...@claassen.co.uk>
>> wrote:
>>> Is there a simple answer for how to get a reference from a panel to the
>>> holding page that is available at compile time (something other than
>>> getPage() on beforeRender())?
>>>
>>> Thanks,
>>> Pieter
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to get a reference to the holding page from a panel

Posted by pieter claassen <pi...@gmail.com>.
Actually I also find that using getPage() on beforeRender() to get the page
is ok as long as do deal with any problems in case you cannot get the page.

Pieter

On Fri, Feb 13, 2009 at 6:34 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> make the panel an anonymous or inner class of the page and use MyPage.this.
>
> -igor
>
> On Fri, Feb 13, 2009 at 6:14 AM, pieter claassen <pi...@claassen.co.uk>
> wrote:
> > Is there a simple answer for how to get a reference from a panel to the
> > holding page that is available at compile time (something other than
> > getPage() on beforeRender())?
> >
> > Thanks,
> > Pieter
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to get a reference to the holding page from a panel

Posted by Igor Vaynberg <ig...@gmail.com>.
make the panel an anonymous or inner class of the page and use MyPage.this.

-igor

On Fri, Feb 13, 2009 at 6:14 AM, pieter claassen <pi...@claassen.co.uk> wrote:
> Is there a simple answer for how to get a reference from a panel to the
> holding page that is available at compile time (something other than
> getPage() on beforeRender())?
>
> Thanks,
> Pieter
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org