You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by yoav Stern <yo...@betamedia.co.il> on 2014/01/20 13:16:22 UTC
when new component is added to the page
My scenario: on an ajax event I replace a webmarkupContainer with one of my
components which have some wicket IBehaviorListener.
The problem is that this replace happen due to ajax request, and the
behavior get listed on dom ready:
Wicket.Event.add(window, "domready", function(event) {
Wicket.Ajax.get({'u': 'some/url', 'c': 'linkId', 'e':'click'}));
// ... more event registrations and onDomReady scripts }
I'm assuming that, being generated in the this event registration code
happens for all components that are added explicitly but not for any
components that are added dynamically by me.
How can I call the new container with the ajax behaviors or change the
current implementation so the wicket ajax behaviors would be called?
Thanks in advance.
Re: when new component is added to the page
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
Please ask your questions in the users@ mailing list.
The Ajax response should contain something similar that will register the
event listener for the replacement component.
So your new component should be Ajax aware.
This JS code is rendered by AjaxEventBehavior#renderHead() method for both
Ajax and normal requests.
Martin Grigorov
Wicket Training and Consulting
On Mon, Jan 20, 2014 at 2:16 PM, yoav Stern <yo...@betamedia.co.il> wrote:
> My scenario: on an ajax event I replace a webmarkupContainer with one of my
> components which have some wicket IBehaviorListener.
>
> The problem is that this replace happen due to ajax request, and the
> behavior get listed on dom ready:
>
> Wicket.Event.add(window, "domready", function(event) {
> Wicket.Ajax.get({'u': 'some/url', 'c': 'linkId', 'e':'click'}));
> // ... more event registrations and onDomReady scripts }
>
> I'm assuming that, being generated in the this event registration code
> happens for all components that are added explicitly but not for any
> components that are added dynamically by me.
>
> How can I call the new container with the ajax behaviors or change the
> current implementation so the wicket ajax behaviors would be called?
>
> Thanks in advance.
>