You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arun Wagle <ar...@gmail.com> on 2008/11/05 06:28:35 UTC

Design question : accessing components between panels

Hello ,

I have an application which renders a page.
This page has two panels , panel A and panel B
Each panel has some components in it.

Now I want to access some component in panel B from panel A.

Can someone tell me how do I get a handle to panel B in panel A ?

If I have an instance of the page, then I can do a *get("id of panel B")* to
get the instance of panel B
But how do I get the instance of the home page in panel A ?

How can I acheive this scenarion in the best possible way?

Can someone please help me as I have lot of cases with these scenarious ?




Regards,
Arun Wagle

Re: Design question : accessing components between panels

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Wed, 05 Nov 2008, Arun Wagle wrote:
> I have an application which renders a page.
> This page has two panels , panel A and panel B
> Each panel has some components in it.
> 
> Now I want to access some component in panel B from panel A.

What exactly do you want to do with the panel B component in
panel A?

> Can someone tell me how do I get a handle to panel B in panel A ?

getPage().visitChildren(PanelB.class, new IVisitor() {
    ...
});

> Can someone please help me as I have lot of cases with these scenarious ?

Then you could have a look at

  https://issues.apache.org/jira/browse/WICKET-1312

and the blog posts referenced in it.

There has also been a lot of discussion of these scenarios 
on this mailing list before, so you could search Nabble on
that.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

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


Re: Design question : accessing components between panels

Posted by Michael Sparer <mi...@gmx.at>.
Whenever getPage() returns null it's most likely that the component isn't
added to a page yet. Just a guess: you're calling getPage() in the
constructor of your panel right? Try calling it in the onBeforeRender method
and page won't return null

hope that helps
Michael

Arun Wagle wrote:
> 
> Hi,
> 
> I had tried getPage() but it returns null to me.
> Is it because the panel in which I am trying to access the other panel
> component is a modal dialog?
> 
> Any suggestions.
> 
> 
> 
> igor.vaynberg wrote:
>> 
>> component#getPage()
>> 
>> -igor
>> 
>> On Tue, Nov 4, 2008 at 9:28 PM, Arun Wagle <ar...@gmail.com>
>> wrote:
>>> Hello ,
>>>
>>> I have an application which renders a page.
>>> This page has two panels , panel A and panel B
>>> Each panel has some components in it.
>>>
>>> Now I want to access some component in panel B from panel A.
>>>
>>> Can someone tell me how do I get a handle to panel B in panel A ?
>>>
>>> If I have an instance of the page, then I can do a *get("id of panel
>>> B")* to
>>> get the instance of panel B
>>> But how do I get the instance of the home page in panel A ?
>>>
>>> How can I acheive this scenarion in the best possible way?
>>>
>>> Can someone please help me as I have lot of cases with these scenarious
>>> ?
>>>
>>>
>>>
>>>
>>> Regards,
>>> Arun Wagle
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: http://www.nabble.com/Design-question-%3A-accessing-components-between-panels-tp20336382p20343221.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Design question : accessing components between panels

Posted by Arun Wagle <ar...@gmail.com>.
Hi,

I had tried getPage() but it returns null to me.
Is it because the panel in which I am trying to access the other panel
component is a modal dialog?

Any suggestions.



igor.vaynberg wrote:
> 
> component#getPage()
> 
> -igor
> 
> On Tue, Nov 4, 2008 at 9:28 PM, Arun Wagle <ar...@gmail.com> wrote:
>> Hello ,
>>
>> I have an application which renders a page.
>> This page has two panels , panel A and panel B
>> Each panel has some components in it.
>>
>> Now I want to access some component in panel B from panel A.
>>
>> Can someone tell me how do I get a handle to panel B in panel A ?
>>
>> If I have an instance of the page, then I can do a *get("id of panel B")*
>> to
>> get the instance of panel B
>> But how do I get the instance of the home page in panel A ?
>>
>> How can I acheive this scenarion in the best possible way?
>>
>> Can someone please help me as I have lot of cases with these scenarious ?
>>
>>
>>
>>
>> Regards,
>> Arun Wagle
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Design-question-%3A-accessing-components-between-panels-tp20336382p20343178.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Design question : accessing components between panels

Posted by Igor Vaynberg <ig...@gmail.com>.
component#getPage()

-igor

On Tue, Nov 4, 2008 at 9:28 PM, Arun Wagle <ar...@gmail.com> wrote:
> Hello ,
>
> I have an application which renders a page.
> This page has two panels , panel A and panel B
> Each panel has some components in it.
>
> Now I want to access some component in panel B from panel A.
>
> Can someone tell me how do I get a handle to panel B in panel A ?
>
> If I have an instance of the page, then I can do a *get("id of panel B")* to
> get the instance of panel B
> But how do I get the instance of the home page in panel A ?
>
> How can I acheive this scenarion in the best possible way?
>
> Can someone please help me as I have lot of cases with these scenarious ?
>
>
>
>
> Regards,
> Arun Wagle
>

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