Tapestry
  1. Tapestry
  2. TAPESTRY-1066

Duplicate listeners added for events in browser every time @EventListener is fired.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JBoss 4.0.4.GA, Firefox 1.5.0.6, Windows XP

      Description

      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.

        Activity

        Ben Sommerville created issue -
        Jesse Kuhnert made changes -
        Field Original Value New Value
        Assignee Jesse Kuhnert [ jkuhnert ]
        Hide
        Jesse Kuhnert added a comment -

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

        Show
        Jesse Kuhnert added a comment - Try the latest snapshot out. I think it's fixed, if it's not I'll have to do something more extensive.
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 4.1.1 [ 12312021 ]
        Hide
        Ben Sommerville added a comment -

        Sorry Jesse,
        With the latest snapshot I still see this problem.

        Were you able to reproduce or is it something in my environment?

        I tried running in IE as well, but the app didn't work properly (on the first change the second select is cleared out, on the second change I get an exception & have to restart).

        I'll try to dig into it further, but probably won't get a chance for a couple of days .

        Show
        Ben Sommerville added a comment - Sorry Jesse, With the latest snapshot I still see this problem. Were you able to reproduce or is it something in my environment? I tried running in IE as well, but the app didn't work properly (on the first change the second select is cleared out, on the second change I get an exception & have to restart). I'll try to dig into it further, but probably won't get a chance for a couple of days .
        Jesse Kuhnert made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Jesse Kuhnert made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        Hide
        Jesse Kuhnert added a comment -

        Almost there with this one. It's a big bug and I want to make sure my solution is elegant enough that it doesn't happen again.

        Show
        Jesse Kuhnert added a comment - Almost there with this one. It's a big bug and I want to make sure my solution is elegant enough that it doesn't happen again.
        Hide
        Jesse Kuhnert added a comment -

        Fixed...finally..

        Show
        Jesse Kuhnert added a comment - Fixed...finally..
        Jesse Kuhnert made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Mark Thomas made changes -
        Workflow jira [ 12381709 ] Default workflow, editable Closed status [ 12568898 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568898 ] jira [ 12590171 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        4h 33m 1 Jesse Kuhnert 15/Aug/06 03:02
        Resolved Resolved Reopened Reopened
        11h 42m 1 Jesse Kuhnert 15/Aug/06 14:45
        Reopened Reopened In Progress In Progress
        13h 53m 1 Jesse Kuhnert 16/Aug/06 04:38
        In Progress In Progress Resolved Resolved
        3d 12h 41m 1 Jesse Kuhnert 19/Aug/06 17:19

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Ben Sommerville
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development