You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nick Pratt <nb...@gmail.com> on 2013/04/12 00:01:46 UTC
AddOrReplace with Ajax
I use addOrReplace fairly frequently in normal requests, but Im having
trouble making this work in an Ajax request.
1. Add EmptyPanel("someId"); to page
2. User clicks link, and then on the server side I do: addOrReplace(new
DetailPanel("someId"));
and the Details Panel appears in place of the EmptyPanel.
How do I make this work in an AjaxLink?
In order to update the component via Ajax, I need its markupId in the
existing markup - EmptyPanel doesnt have one (or has a different one to the
DetailPanel).
Should I set the markupId of the EmptyPanel and the constructed DetailPanel
to be the same value?
Regards
Nick
Re: AddOrReplace with Ajax
Posted by Igor Vaynberg <ig...@gmail.com>.
addOrReplace will copy the id for you.
you just have to make sure that the component you are replacing has
its setOutputMarkupId() set to true during the initial non-ajax
render. from then on everything will work the same.
-igor
On Thu, Apr 11, 2013 at 3:01 PM, Nick Pratt <nb...@gmail.com> wrote:
> I use addOrReplace fairly frequently in normal requests, but Im having
> trouble making this work in an Ajax request.
>
> 1. Add EmptyPanel("someId"); to page
> 2. User clicks link, and then on the server side I do: addOrReplace(new
> DetailPanel("someId"));
> and the Details Panel appears in place of the EmptyPanel.
>
> How do I make this work in an AjaxLink?
>
> In order to update the component via Ajax, I need its markupId in the
> existing markup - EmptyPanel doesnt have one (or has a different one to the
> DetailPanel).
>
> Should I set the markupId of the EmptyPanel and the constructed DetailPanel
> to be the same value?
>
> Regards
>
> Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org