ICEfaces
  1. ICEfaces
  2. ICE-7665

ace:maskedEntry: AjaxListener being triggered twice in IE7/8

    Details

      Description

      The ajaxListener is being called twice, and the values on the page are being incremented twice as well. The expected / actual results are below:

      Expected message = "AjaxBehaviorEvent received! (#1)", Actual message = AjaxBehaviorEvent received! (#2)
      Expected value A = 1, Actual value = 2
      Expected value B = 1, Actual value = 2

      To reproduce:
      1. Build / deploy test application from location above
      2. Navigate to MaskedEntry Ajax test
      3. Use the app to test each of these scenarios that are producing the wrong results:
      "valueChange" Event Test
      Default Event Test
      "valueChange" Event Test w/ ValueChangeListener attribute

        Activity

        Hide
        yip.ng added a comment - - edited

        Traced code. "valueChange" is being bound as "change" event in jQuery. No double binding of listener.

        Known issue. See, for example, http://stackoverflow.com/questions/7008527/jquery-onchange-event-fires-twice-in-ie8.

        Some suggestions. None of them look simple, generic and cross-browser safe. Further, Grimlock wrapper JS looks very trivial. All the complicated stuff is in the third-party masked input plugin. Need deeper understanding of plugin first.

        Show
        yip.ng added a comment - - edited Traced code. "valueChange" is being bound as "change" event in jQuery. No double binding of listener. Known issue. See, for example, http://stackoverflow.com/questions/7008527/jquery-onchange-event-fires-twice-in-ie8 . Some suggestions. None of them look simple, generic and cross-browser safe. Further, Grimlock wrapper JS looks very trivial. All the complicated stuff is in the third-party masked input plugin. Need deeper understanding of plugin first.
        Hide
        yip.ng added a comment - - edited

        Cause: bug in jQuery that fires extra change events on the IE beforedeactivate event. See screenshot-1.png. (This may be general to all input elements, not just specific to masked input. I have seen mention of select and checkbox elements as well on the web.)

        Fixed in jQuery 1.7. See screenshot-2.png and jQuery 1.7 release notes: http://blog.jquery.com/2011/11/03/jquery-1-7-released/#comment-528188.

        We have jQuery 1.6.2. May not be easy to just figure out and transplant the relevant changes because of the "complete rewrite of the events system" in jQuery 1.7. (There are 866 differences between the 2 versions.)

        Show
        yip.ng added a comment - - edited Cause: bug in jQuery that fires extra change events on the IE beforedeactivate event. See screenshot-1.png. (This may be general to all input elements, not just specific to masked input. I have seen mention of select and checkbox elements as well on the web.) Fixed in jQuery 1.7. See screenshot-2.png and jQuery 1.7 release notes: http://blog.jquery.com/2011/11/03/jquery-1-7-released/#comment-528188 . We have jQuery 1.6.2. May not be easy to just figure out and transplant the relevant changes because of the "complete rewrite of the events system" in jQuery 1.7. (There are 866 differences between the 2 versions.)
        Hide
        yip.ng added a comment -

        jQuery will be upgraded in ICE-7895.

        Show
        yip.ng added a comment - jQuery will be upgraded in ICE-7895 .

          People

          • Assignee:
            yip.ng
            Reporter:
            Cruz Miraback
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: