Hi,

On Thu, Nov 19, 2015 at 10:44 PM, EC James <[email protected]> wrote:

> I have a page with a Tabbed interface(not wicket) that performs actions
> before and after the domready signal.
>
> It has it's own signal for when it is complete:
> $( document ).on( "wb-ready.wb", function( event ) {
>         //The page is fully loaded now.
> }
>
> The rendering order is like this:
> 1) Tab 1 rendered
> 2) Page loaded (domready)
> 3) Tab 1 rendered
> 4) Done loading (wb-ready.wb)
>
> I have an AjaxButton in Tab 1 that does not work. It works fine outside the
> tab.
>
> I'm guessing that something is happening in the 3rd stage that removes the
> event listener.
>

Yes. If you re-render the tab's content then you replace the original DOM
element for the button and thus you lose its event listener.
Why do you need to re-render the content?
Is it OK for you if you preserve the button? You can use jQuery.clone(true,
true) to make a clone that preserves the event listeners and put this clone
after the re-render.


>
> As a test, if I take the following from the header and put it in the
> "wb-ready.wb" all is good. Of course this only
> works as a test as I have to manually change the url.
> /**/
>
> I have no idea how to fix this. All I can imagine is:
> 1) Somehow rerunning Wicket.Event.add after "wb-ready.wb", or
> 2) Moving Wicket.Event.add out of the head and into "wb-ready.wb", which I
> don't think is possible.
>
> Any ideas on how to reregister the event listener for the button?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Event-listeners-not-working-after-Javascript-actions-tp4672673.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to