You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bertrand Guay-Paquet (JIRA)" <ji...@apache.org> on 2012/08/01 18:18:03 UTC

[jira] [Commented] (WICKET-4689) Javascript timers not removed when a Component is replaced by ajax

    [ https://issues.apache.org/jira/browse/WICKET-4689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426727#comment-13426727 ] 

Bertrand Guay-Paquet commented on WICKET-4689:
----------------------------------------------

Possible solution on the client-side :

New code when ajax response is received :
replacedDOMElement = ...;
$replacedDOMElement  = $(replacedDOMElement);
for each js timers:
    $component = $(timer.component);
    if( $replacedDOMElement.is($component) ||
        $replacedDOMElement.find($component ).length ) {

        cancelTimer(timer);
    }


To which Martin Grigorov replied:
Yes [this would work]
Wicket sends a message on topic '/dom/node/removed' for each removed element.
Using its id we can stop the timer.


I don't know what these message topics are however so I can't comment much further! My only possibly relevant concern is that timers of all children of a replaced element should be stopped as well in case some markup ids match.


                
> Javascript timers not removed when a Component is replaced by ajax
> ------------------------------------------------------------------
>
>                 Key: WICKET-4689
>                 URL: https://issues.apache.org/jira/browse/WICKET-4689
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.0.0-beta3
>            Reporter: Bertrand Guay-Paquet
>              Labels: ajax, timer
>         Attachments: quickstart.zip
>
>
> The timer's javascript precondition checks that the component (html element) on which is
> attached the timer behavior is still in the DOM document. When a component with a timer behavior is replaced in java in an ajax request by another component without this behavior, this check is not enough. In this case, the component id is still in the DOM (it was replaced by another one by the same id).
> See email thread at:
> http://apache-wicket.1842946.n4.nabble.com/ComponentNotFoundException-when-replace-a-fragment-with-ajax-tp4650898.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira