Thanks Timo,

Right now, I just put it in the constructor of panelB. But then again, panelB 
is tied up to panelA. :(

I'm going to try your solution!

Thanks,
Allan
 
--
The only constant in life is change.

----- Original Message ----
From: Timo Rantalaiho <[EMAIL PROTECTED]>
To: users@wicket.apache.org
Sent: Tuesday, January 15, 2008 8:49:28 AM
Subject: Re: how to reference component in RequestTarget


On Mon, 14 Jan 2008, Beyonder Unknown wrote:
> I was wondering what is the best practice when referencing components
 inside an onClick/onSubmit. Normally:
> 
>                     public void onClick(AjaxRequestTarget target) {
>                               //do things here.
>                                 //update these components.
>                               target.addComponent(panelA);
>                               target.addComponent(panelB);
> 
>                     }
> 
> But what if you don't have direct access to PanelA or PanelB? 

As far as I know, there is currently no single recommended
way of doing this. We've tried abstract callback methods and
different ajax-update-listener objects but have found all of
them left wanting.

Sometimes something like this

    getPage().visitChildren(PanelA.class, new IVisitor() {
        ... target.addComponent(component);
    ...
    }

might work and we've used a more generic solution along
those lines as well. 

You can also search the list on this, one thread was called
something like "inter component events".

Best wishes,
Timo

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

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






      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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

Reply via email to