You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org> on 2006/08/15 04:04:14 UTC

[jira] Resolved: (TAPESTRY-1066) Duplicate listeners added for events in browser every time @EventListener is fired.

     [ http://issues.apache.org/jira/browse/TAPESTRY-1066?page=all ]

Jesse Kuhnert resolved TAPESTRY-1066.
-------------------------------------

    Fix Version/s: 4.1.1
       Resolution: Fixed

Try the latest snapshot out. I think it's fixed, if it's not I'll have to do something more extensive. 

> Duplicate listeners added for events in browser every time @EventListener is fired.
> -----------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1066
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1066
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.1.1
>         Environment: JBoss 4.0.4.GA,  Firefox 1.5.0.6, Windows XP
>            Reporter: Ben Sommerville
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.1
>
>
> The response from an @EventListener method seems to reregister for that event on the browser.  The effect of this is the first time you trigger the event one ajax call is made, the second time two calls are made, the third time eight calls are made, etc.
> The testcase I submitted for [TAPESTRY-1054] shows this.  Every time I change the first select, the number of ajax calls doubles.
> Each response includes something like
> <response id="initializationscript" type="script"><script>
> //<![CDATA[
> tapestry.form.clearProfiles('loginRole'); tapestry.form.registerProfile('loginRole',{});
>                 dojo.event.connect(dojo.byId("role"), "onchange", function(e){
>                     var content={beventname:"onchange"};
>                     tapestry.event.buildEventProperties(e, content);
>                     if (!content["beventtarget.id"]) content["beventtarget.id"]="role";
>                     
>                    var validateState=tapestry.form.forms["loginRole"].validateForm;
>                    var validateForm=false;
>                    tapestry.form.setFormValidating("loginRole", validateForm);
>                     tapestry.form.submitAsync("loginRole", content);
>                     
>                     tapestry.form.setFormValidating("loginRole", validateState);
>                     
>                 });
> //]]>
> </script></response>
> I assume the "dojo.event.connect" call is the culprit, but I haven't had a chance to dig into the code to work out why or where it is being added to the response.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org