ICEfaces
  1. ICEfaces
  2. ICE-8574

onSubmitSend and onAfterUpdate not being called for certain component actions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.BETA1, 3.2
    • Fix Version/s: 3.2, 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1

      Description


      The onSubmitSend and onAfterUpdate JavaScript events are no longer being called for every server side submit. Examples of this is onchange/blur of an inputText field or the switching of tabs for the ace:tabSet

        Activity

        Hide
        Arran Mccullough added a comment - - edited

        This is an issue with the Williams app. They have these events integrated into their notification popup.
        (Restricted to icesoft-internal-developers group)

        Show
        Arran Mccullough added a comment - - edited This is an issue with the Williams app. They have these events integrated into their notification popup. (Restricted to icesoft-internal-developers group)
        Hide
        Arran Mccullough added a comment - - edited

        Attached test case that shows issues.

        Steps:

        • Load welcomeICEfaces.jsf
        • Click on the Test button, the events are correctly executed.
        • Enter in some text to the input field and tab or focus out. The events are not executed.
        • Change the displayed tab, again the events are not executed.
        Show
        Arran Mccullough added a comment - - edited Attached test case that shows issues. Steps: Load welcomeICEfaces.jsf Click on the Test button, the events are correctly executed. Enter in some text to the input field and tab or focus out. The events are not executed. Change the displayed tab, again the events are not executed.
        Hide
        Ken Fyten added a comment - - edited

        Need this looked at asap - Mircea is out the rest of this week.
        (Restricted to icesoft-internal-developers group)

        Show
        Ken Fyten added a comment - - edited Need this looked at asap - Mircea is out the rest of this week. (Restricted to icesoft-internal-developers group)
        Hide
        Deryk Sinotte added a comment - - edited

        These are the two stack traces for the two registered callbacks in the test case:
        Stack Trace for button click (onBeforeSend)

            (anonymous function)       (script.js.jsf:4)
            apply                      (bridge.uncompressed.js.jsf:122)
            (anonymous function)       (bridge.uncompressed.js.jsf:484)
            (anonymous function)       (bridge.uncompressed.js.jsf:363)
            (anonymous function)       (bridge.uncompressed.js.jsf:240)
            broadcast                  (bridge.uncompressed.js.jsf:483)
            (anonymous function)       (bridge.uncompressed.js.jsf:1928)
            options.onevent            (bridge.uncompressed.js.jsf:2243)
            sendEvent                  (jsf.js.jsf:1563)
            AjaxEngine.req.sendRequest (jsf.js.jsf:1454)
            request                    (jsf.js.jsf:1955)
            fullSubmit                 (bridge.uncompressed.js.jsf:2308)
            submit                     (bridge.uncompressed.js.jsf:2313)
            f.onsubmit                 (bridge.uncompressed.js.jsf:2456)
        

        Stack trace for button click (onAfterUpdate)

            (anonymous function)                     (script.js.jsf:10)
            apply                                    (bridge.uncompressed.js.jsf:122)
            (anonymous function)                     (bridge.uncompressed.js.jsf:484)
            (anonymous function)                     (bridge.uncompressed.js.jsf:363)
            (anonymous function)                     (bridge.uncompressed.js.jsf:240)
            broadcast                                (bridge.uncompressed.js.jsf:483)
            (anonymous function)                     (bridge.uncompressed.js.jsf:1940)
            options.onevent                          (bridge.uncompressed.js.jsf:2243)
            sendEvent                                (jsf.js.jsf:1563)
            response                                 (jsf.js.jsf:2200)
            onComplete                               (jsf.js.jsf:1348)
            AjaxEngine.req.xmlReq.onreadystatechange (jsf.js.jsf:1329)
        

        I believe the "sendEvent" function is the key for all these cases. Inside that function is the following logic:

            var sendEvent = function sendEvent(request, context, status) {
            ...
                if (context.onevent) {
                    context.onevent.call(null, data);
                }
            ....
        

        With the button, each time this code is run, the onevent callback is set to the function we use to do the callbacks for our APIs:

            context: Object
            formid: "iceForm"
            onerror: function (submitEvent) {
            onevent: function (submitEvent) {
            render: "@all"
            sourceid: "iceForm:_t9"
            __proto__: Object
        

        The full onevent function looks like this:

            function (submitEvent) {
                pageScopedSubmitEventBroadcaster(submitEvent, element);
                requestScopedSubmitEventBroadcaster(submitEvent, element);
            }
        

        For the inputField, when onblur is triggered, onevent is simply false for all status phases (begin, complete, success), so no callbacks are fired:

            context: Object
            formid: "iceForm"
            onerror: false
            onevent: false
            render: "@all"
            sourceid: "iceForm:_t10"
            __proto__: Object 
        

        Hitting the Enter key while in the inputText field actually does trigger our event broadcaster.
        For the tabs, it's a slightly different problem. There is a function registered with onevent but it's not ours:

            context: Object
            formid: "iceForm"
            onerror: function (submitEvent) {
            onevent: function (I){if(I.status=="success"&&t.newValue==g){v();}}
            render: "@all"
            sourceid: "iceFormyti"
            __proto__: Object
        

        Looks to be a YAHOO function (from ace-yui.js) that replaces ours (the onerror function is still ours):

            function (I){
                if(I.status=="success"&&t.newValue==g){
                    v();
                }
            }
        
        Show
        Deryk Sinotte added a comment - - edited These are the two stack traces for the two registered callbacks in the test case: Stack Trace for button click (onBeforeSend) (anonymous function) (script.js.jsf:4) apply (bridge.uncompressed.js.jsf:122) (anonymous function) (bridge.uncompressed.js.jsf:484) (anonymous function) (bridge.uncompressed.js.jsf:363) (anonymous function) (bridge.uncompressed.js.jsf:240) broadcast (bridge.uncompressed.js.jsf:483) (anonymous function) (bridge.uncompressed.js.jsf:1928) options.onevent (bridge.uncompressed.js.jsf:2243) sendEvent (jsf.js.jsf:1563) AjaxEngine.req.sendRequest (jsf.js.jsf:1454) request (jsf.js.jsf:1955) fullSubmit (bridge.uncompressed.js.jsf:2308) submit (bridge.uncompressed.js.jsf:2313) f.onsubmit (bridge.uncompressed.js.jsf:2456) Stack trace for button click (onAfterUpdate) (anonymous function) (script.js.jsf:10) apply (bridge.uncompressed.js.jsf:122) (anonymous function) (bridge.uncompressed.js.jsf:484) (anonymous function) (bridge.uncompressed.js.jsf:363) (anonymous function) (bridge.uncompressed.js.jsf:240) broadcast (bridge.uncompressed.js.jsf:483) (anonymous function) (bridge.uncompressed.js.jsf:1940) options.onevent (bridge.uncompressed.js.jsf:2243) sendEvent (jsf.js.jsf:1563) response (jsf.js.jsf:2200) onComplete (jsf.js.jsf:1348) AjaxEngine.req.xmlReq.onreadystatechange (jsf.js.jsf:1329) I believe the "sendEvent" function is the key for all these cases. Inside that function is the following logic: var sendEvent = function sendEvent(request, context, status) { ... if (context.onevent) { context.onevent.call( null , data); } .... With the button, each time this code is run, the onevent callback is set to the function we use to do the callbacks for our APIs: context: Object formid: "iceForm" onerror: function (submitEvent) { onevent: function (submitEvent) { render: "@all" sourceid: "iceForm:_t9" __proto__: Object The full onevent function looks like this: function (submitEvent) { pageScopedSubmitEventBroadcaster(submitEvent, element); requestScopedSubmitEventBroadcaster(submitEvent, element); } For the inputField, when onblur is triggered, onevent is simply false for all status phases (begin, complete, success), so no callbacks are fired: context: Object formid: "iceForm" onerror: false onevent: false render: "@all" sourceid: "iceForm:_t10" __proto__: Object Hitting the Enter key while in the inputText field actually does trigger our event broadcaster. For the tabs, it's a slightly different problem. There is a function registered with onevent but it's not ours: context: Object formid: "iceForm" onerror: function (submitEvent) { onevent: function (I){ if (I.status== "success" &&t.newValue==g){v();}} render: "@all" sourceid: "iceFormyti" __proto__: Object Looks to be a YAHOO function (from ace-yui.js) that replaces ours (the onerror function is still ours): function (I){ if (I.status== "success" &&t.newValue==g){ v(); } }
        Hide
        Mircea Toma added a comment - - edited

        Modified ICEfaces callback invocation behavior. Now ICEfaces specific callbacks are invoked when the view is ICEfaces enabled, regardless of the function used to submit the form.

        Show
        Mircea Toma added a comment - - edited Modified ICEfaces callback invocation behavior. Now ICEfaces specific callbacks are invoked when the view is ICEfaces enabled, regardless of the function used to submit the form.
        Hide
        Ken Fyten added a comment - - edited

        In IE7 I'm getting JS errors when navigating to any sample page (no errors in other browsers):

        1) Expected identifier, string or number
        2) 'log' is null or not an object
        3) Object doesn't support this property or method
        4) 'configuration.disableDefaultErrorPopups' is null or not an object
        Show
        Ken Fyten added a comment - - edited In IE7 I'm getting JS errors when navigating to any sample page (no errors in other browsers): 1) Expected identifier, string or number 2) 'log' is null or not an object 3) Object doesn't support this property or method 4) 'configuration.disableDefaultErrorPopups' is null or not an object
        Hide
        Deryk Sinotte added a comment -

        So I ran the test case as it stands and could see the originally reported issue. Then I swapped out the libraries and used the latest from the icefaces3/trunk (rev 33566) then re-ran the test using Chrome, IE 9 (in IE9/8/7 modes), as well as a "real" copy of IE7 and everything worked fine for me. I didn't see any JS errors and the popups came up as expected.

        I also checked against the official 3.2 libs and everything seems to work fine there.

        Show
        Deryk Sinotte added a comment - So I ran the test case as it stands and could see the originally reported issue. Then I swapped out the libraries and used the latest from the icefaces3/trunk (rev 33566) then re-ran the test using Chrome, IE 9 (in IE9/8/7 modes), as well as a "real" copy of IE7 and everything worked fine for me. I didn't see any JS errors and the popups came up as expected. I also checked against the official 3.2 libs and everything seems to work fine there.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: