When Wicket is replacing parts of your page via AJAX, you're losing the
click handlers - the one's you added on $('#foo') are no longer valid since
Wicket just removed and replace the #foo element.

On Fri, Apr 3, 2015 at 4:02 PM, Chris <chris...@gmx.at> wrote:

> Hi Sebastian,
>
> thanks a lot - it basically works but still I have a problem.
>
> Intro:
> I am using a JS library to display tooltips for certain elements in the
> DOM tree.
> The problem are tooltips for elements in a div container which is reloaded
> by Ajax. After reloading the container, the tooltips cannot be hidden
> anymore (seems that they cannot be referenced anymore). Therefore, as soon
> as the ajax link is clicked, I am calling a JS method to hide and disable
> the tooltips..
>
> Problem:
> When I call the page and click the ajax link, the JS method (to hide the
> tooltips) is called correctly. However, as soon as some container of the
> page is reloaded by Ajax and I click the link, the Javascript is not called
> anymore. The link is part of the container that is reloaded.
>
> I am calling the Javascript method via:
> $(„#link").click(function () {…}
>
> The Javascript is loaded in the Page via:
> response.render(JavaScriptReferenceHeaderItem.forReference(JS-File));
>
> Thanks a lot,
> Chris
>
>
> > Am 03.04.2015 um 21:34 schrieb Sebastien <seb...@gmail.com>:
> >
> > response.render is also correct if belonging to the component you are
> > re-adding. Idem, the scope is the issue imo
> > On Apr 3, 2015 9:31 PM, "Sebastien" <seb...@gmail.com> wrote:
> >
> >> Hi Chris,
> >> target.appendJavaScript should work, but your method is probably on
> window
> >> scope, try window.method();
> >> Also, check on the ajaxdebugwindow if the statement has well been added
> >> for execution and it does not indicate an error...
> >> Sebastien
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to