Tauren Mills wrote:

>       add(new AjaxLink("createLink") {
>               @Override
>               public void onClick(AjaxRequestTarget target) {
>                       Panel panel = new ContactEditPanel("panel",
>                                       new Model(new Contact()));
>                       panel.setOutputMarkupId(true);
>                       getParent().replaceWith(panel);
>                       target.addComponent(panel);
>               }
>       });

> What is the proper way to replace the containing panel from a 
> control within that panel? I found similar questions posted on 
> this list, but I haven't got any of those solutions to work for me.

I think you just need to do target.addComponent(getParent()) instead.  If
the parent contains too much (like the whole page), then put your Panel
inside another Panel, a Fragment, or a div tied to a WebMarkupContainer.
-- 
View this message in context: 
http://www.nabble.com/How-to-replace-panelA-with-panelB-using-AjaxLink-in-panelA-tf4259660.html#a12161515
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to