ICEfaces
  1. ICEfaces
  2. ICE-8372

blockUIOnSubmit doesn't consistently unblock the UI

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0.RC1
    • Fix Version/s: 3.1
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      IF 3.x Showcase
    • Assignee Priority:
      P1

      Description

      BlockUIOnSubmit=true doesn't consistently unblock following submit return when used in the showcase app.

        Activity

        Nils Lundquist created issue -
        Nils Lundquist made changes -
        Field Original Value New Value
        Assignee Nils Lundquist [ nils.lundquist ]
        Ken Fyten made changes -
        Summary blockUIOnSubmit doesn't unblock the UI blockUIOnSubmit doesn't consistently unblock the UI
        Salesforce Case []
        Component/s Bridge [ 10011 ]
        Fix Version/s 3.1 [ 10312 ]
        Fix Version/s 3.2 [ 10338 ]
        Assignee Priority P1
        Affects Version/s 3.1.0.RC1 [ 10337 ]
        Description BlockUIOnSubmit doesn't unblock following submit return when used in the showcase app. BlockUIOnSubmit=true doesn't consistently unblock following submit return when used in the showcase app.
        Assignee Nils Lundquist [ nils.lundquist ] Mircea Toma [ mircea.toma ]
        Hide
        Nils Lundquist added a comment -

        The stopBlockingUI callback defined to run on onAfterUpdate is never executed.

        The pre-request callback to setup the stopBlockingUI callback runs correctly though.

        Show
        Nils Lundquist added a comment - The stopBlockingUI callback defined to run on onAfterUpdate is never executed. The pre-request callback to setup the stopBlockingUI callback runs correctly though.
        Hide
        Nils Lundquist added a comment -

        The submitEventBroadcaster function returns a method to broadcast listeners for particular events; it is never called for the 'success' event, though the 'begin' and 'complete' events are both processed.

        Show
        Nils Lundquist added a comment - The submitEventBroadcaster function returns a method to broadcast listeners for particular events; it is never called for the 'success' event, though the 'begin' and 'complete' events are both processed.
        Nils Lundquist made changes -
        Attachment Credit Acceptance SOW Jul 15 2012_REVISED.pdf [ 14704 ]
        Nils Lundquist made changes -
        Attachment Credit Acceptance SOW Jul 15 2012_REVISED.pdf [ 14704 ]
        Nils Lundquist made changes -
        Comment [ Attached SOW ]
        Hide
        Mircea Toma added a comment -

        Can you provide the required steps to go through to reproduce this issue?

        Show
        Mircea Toma added a comment - Can you provide the required steps to go through to reproduce this issue?
        Hide
        Nils Lundquist added a comment -

        Use blockUIOnSubmit via web.xml config param or icecore:config.

        When causing an ajax request using any component (checking checkbox, paginating datatable, etc.) the translucent block UI plane is displayed, and the update is visibly applied to the page, but the block UI plane is never hidden.

        Very easy to reproduce.

        Show
        Nils Lundquist added a comment - Use blockUIOnSubmit via web.xml config param or icecore:config. When causing an ajax request using any component (checking checkbox, paginating datatable, etc.) the translucent block UI plane is displayed, and the update is visibly applied to the page, but the block UI plane is never hidden. Very easy to reproduce.
        Hide
        Nils Lundquist added a comment -

        I'd note that Ken changed the error text to read 'consistently'. I observed that all ajax requests were similarly bugged.

        Show
        Nils Lundquist added a comment - I'd note that Ken changed the error text to read 'consistently'. I observed that all ajax requests were similarly bugged.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30016 Tue Jul 17 08:24:39 MDT 2012 mircea.toma ICE-8372 Modified filterICEfacesEvents to use only the call stack lookup method to determine if the submit is triggered by ICEfaces bridge. Adapted the lookup mechanism to work with Myfaces as well. Also the XHR object is now consistently used as thread context variable, in Myfaces or Mojarra.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/application.js
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/submit.js
        Hide
        Mircea Toma added a comment -

        This issue is triggered when the received updates wipe out the form used for the postback. During 'success' submit event, which is triggered after the updates are applied, the lookup for the form fails thus canceling the execution of the 'onAfterUpdate' callbacks. This causes the failure because blockUI feature relies on the onAfterUpdate functionality.

        Show
        Mircea Toma added a comment - This issue is triggered when the received updates wipe out the form used for the postback. During 'success' submit event, which is triggered after the updates are applied, the lookup for the form fails thus canceling the execution of the 'onAfterUpdate' callbacks. This causes the failure because blockUI feature relies on the onAfterUpdate functionality.
        Hide
        Mircea Toma added a comment -

        Modified filterICEfacesEvents to use only the call stack lookup method to determine if the submit is triggered by ICEfaces bridge. Adapted the lookup mechanism to work with Myfaces as well. Also the XHR object is now consistently used as thread context variable, in Myfaces or Mojarra.

        Show
        Mircea Toma added a comment - Modified filterICEfacesEvents to use only the call stack lookup method to determine if the submit is triggered by ICEfaces bridge. Adapted the lookup mechanism to work with Myfaces as well. Also the XHR object is now consistently used as thread context variable, in Myfaces or Mojarra.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        With this change, the blockUIOnSubmit blocker no longer activates at all when singleSubmit is used.

        To reproduce, use the showcase sample, the ace:dialog Effects demo, select different dialog sizes or effects using the h:selectOneMenu components. The blocker is not invoked. However, it was previous to this commit.

        Show
        Ken Fyten added a comment - With this change, the blockUIOnSubmit blocker no longer activates at all when singleSubmit is used. To reproduce, use the showcase sample, the ace:dialog Effects demo, select different dialog sizes or effects using the h:selectOneMenu components. The blocker is not invoked. However, it was previous to this commit.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30035 Tue Jul 17 14:13:58 MDT 2012 mircea.toma ICE-8372 Modify detectCaller() function to return false instead of throwing an error when the passed in function cannot be found in the call stack. This gives a chance to filterICEfacesEvents to try to search for fullSubmit then singleSubmit functions.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/application.js
        Hide
        Mircea Toma added a comment -

        Modified detectCaller() function to return false instead of throwing an error when the passed in function cannot be found in the call stack. This gives a chance to filterICEfacesEvents to try to search for fullSubmit then singleSubmit functions.

        Show
        Mircea Toma added a comment - Modified detectCaller() function to return false instead of throwing an error when the passed in function cannot be found in the call stack. This gives a chance to filterICEfacesEvents to try to search for fullSubmit then singleSubmit functions.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30066 Wed Jul 18 09:25:56 MDT 2012 mircea.toma ICE-8372 Added detection for recursive calls to detectCaller() function.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/application.js
        Hide
        Mircea Toma added a comment -

        Added detection for recursive calls into detectCaller() function to avoid infinite loops while inspecting the call stack.

        Show
        Mircea Toma added a comment - Added detection for recursive calls into detectCaller() function to avoid infinite loops while inspecting the call stack.
        Hide
        Ken Fyten added a comment -

        We have regression failures with MyFaces and Webkit browsers related to these changes:

        Deryk says:

        I was testing showcase-portlets running on MyFaces yesterday and seeing some client-side errors. I then tested the non-portlet version of showcase and saw the same issues.

        The relevant points are:

        • The errors appear to be constrained to the client during Ajax submissions. For example, when submitting a date with dateTimeEntry example, I got the following in the client console: http://dl.dropbox.com/u/14124/Screenshots/myfaces-datetime-console.png. Note that it does a submit that causes an error which eventually leads to a full reload of the page in this component.
        • The problems look to be only occurring on WebKit (Safari, Chrome) browsers. Firefox either doesn't show the same issues or they are handled differently.
        • It appears that most components are affected in some way. As noted above, the dateTimeEntry shows the problem when the submit button is pressed. With the checkBoxButton, it appears to do an Ajax request during initial page load (which seems wrong to me): http://dl.dropbox.com/u/14124/Screenshots/myfaces-checkBoxButton-console.png.

        Ken has noted that the changes for http://jira.icesoft.org/browse/ICE-8372 look to be the root of the issue. Revision 30015 works and 30016 shows the problems.

        Show
        Ken Fyten added a comment - We have regression failures with MyFaces and Webkit browsers related to these changes: Deryk says: I was testing showcase-portlets running on MyFaces yesterday and seeing some client-side errors. I then tested the non-portlet version of showcase and saw the same issues. The relevant points are: The errors appear to be constrained to the client during Ajax submissions. For example, when submitting a date with dateTimeEntry example, I got the following in the client console: http://dl.dropbox.com/u/14124/Screenshots/myfaces-datetime-console.png . Note that it does a submit that causes an error which eventually leads to a full reload of the page in this component. The problems look to be only occurring on WebKit (Safari, Chrome) browsers. Firefox either doesn't show the same issues or they are handled differently. It appears that most components are affected in some way. As noted above, the dateTimeEntry shows the problem when the submit button is pressed. With the checkBoxButton, it appears to do an Ajax request during initial page load (which seems wrong to me): http://dl.dropbox.com/u/14124/Screenshots/myfaces-checkBoxButton-console.png . Ken has noted that the changes for http://jira.icesoft.org/browse/ICE-8372 look to be the root of the issue. Revision 30015 works and 30016 shows the problems.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Deryk Sinotte added a comment -

        So in one of the edits to application.js, there is this code specific to MyFaces where it looks like it tries to go up the call stack to find the XMLHttpRequest parameter:

        function filterICEfacesEvents(f) {
        return function(e) {
        var isICEfacesEvent = false;
        var xmlHttpRequestParameter
        //lookup the XMLHttpRequest parameter of the calling function to use it as a thread context variable,
        //avoiding thus to use global variables
        if (window.myfaces) {
        //lookup the stack: filterICEfacesEvents < broadCastFunc < arrForEach < each < broadcastEvent < sendEvent [argument 0]
        var xmlHttpRequestParameter = arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments[0] ;
        ...

        From debugging, it looks like the assumption about the size of the call stack is off. I can only resolve this far down:

        arguments.callee.caller.arguments.callee.caller

        At that point, then next "arguments" in the chain is null which leads to an error. In Firefox, this doesn't appear to happen but in Chrome, when trying to resolve the chain, it states that the arguments to the forEach() function is "native code" so it returns null.

        arguments.callee.caller.arguments.callee.caller
        -> function forEach()

        { [native code] }

        arguments.callee.caller.arguments.callee.caller.arguments
        -> null

        Show
        Deryk Sinotte added a comment - So in one of the edits to application.js, there is this code specific to MyFaces where it looks like it tries to go up the call stack to find the XMLHttpRequest parameter: function filterICEfacesEvents(f) { return function(e) { var isICEfacesEvent = false; var xmlHttpRequestParameter //lookup the XMLHttpRequest parameter of the calling function to use it as a thread context variable, //avoiding thus to use global variables if (window.myfaces) { //lookup the stack: filterICEfacesEvents < broadCastFunc < arrForEach < each < broadcastEvent < sendEvent [argument 0] var xmlHttpRequestParameter = arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments.callee.caller.arguments [0] ; ... From debugging, it looks like the assumption about the size of the call stack is off. I can only resolve this far down: arguments.callee.caller.arguments.callee.caller At that point, then next "arguments" in the chain is null which leads to an error. In Firefox, this doesn't appear to happen but in Chrome, when trying to resolve the chain, it states that the arguments to the forEach() function is "native code" so it returns null. arguments.callee.caller.arguments.callee.caller -> function forEach() { [native code] } arguments.callee.caller.arguments.callee.caller.arguments -> null
        Hide
        Ken Fyten added a comment -

        Another regression that started as of 30016 is:

        All browsers: ICE-3871 (Fail manually, the outputConnectionStatus does not change its label to 'Disconnected', as expected by the test; in IE only the label changed to 'Caution').

        This issue is still present as of svn rvn# 30076.

        Show
        Ken Fyten added a comment - Another regression that started as of 30016 is: All browsers: ICE-3871 (Fail manually, the outputConnectionStatus does not change its label to 'Disconnected', as expected by the test; in IE only the label changed to 'Caution'). This issue is still present as of svn rvn# 30076.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30102 Thu Jul 19 09:17:16 MDT 2012 mircea.toma ICE-8372 Removed filterICEFacesEvents() function. Instead of filtering events the page scoped submit callbacks are wired (along with the request scoped submit callbacks) to be invoked every time fullSubmit, singleSubmit or requestUpdate functions are invoked.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/application.js
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/submit.js
        Hide
        Mircea Toma added a comment -

        Removed filterICEFacesEvents() function. Instead of filtering events the page scoped submit callbacks are wired (along with the request scoped submit callbacks) to be invoked every time fullSubmit, singleSubmit or requestUpdate functions are invoked.

        This approach, in effect, simulates the behavior we used to have when filtering events but with the advantage of much simpler and faster code.

        Show
        Mircea Toma added a comment - Removed filterICEFacesEvents() function. Instead of filtering events the page scoped submit callbacks are wired (along with the request scoped submit callbacks) to be invoked every time fullSubmit, singleSubmit or requestUpdate functions are invoked. This approach, in effect, simulates the behavior we used to have when filtering events but with the advantage of much simpler and faster code.
        Arran Mccullough made changes -
        Salesforce Case [5007000000NHJu4]
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Carmen Cristurean added a comment -

        Re-opening as instructed by Ken.
        The following ace:progressBar ajax tests fail due to JS errors occurring in all browsers.
        Test application is located here: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/progressBar
        Test page: http://localhost:8080/progressBar/progressBarAjax.jsf

        1) 'cancel' Event Test (render=@all): JS error when clicking on Cancel button:
        In IE8:
        Webpage error details
        User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
        Timestamp: Fri, 20 Jul 2012 17:15:52 UTC

        Message: Exception thrown and not caught
        Line: 1
        Char: 16627
        Code: 0
        URI: http://localhost:8080/progressBar/javax.faces.resource/bridge.js.jsf?v=28218271

        2) 'change' Event Test (render=@all) : same JS error when progressBar reaches the end.

        In Firefox and Chrome, for both tests the error in console is: Error: uncaught exception: cannot find enclosing form.

        Show
        Carmen Cristurean added a comment - Re-opening as instructed by Ken. The following ace:progressBar ajax tests fail due to JS errors occurring in all browsers. Test application is located here: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/progressBar Test page: http://localhost:8080/progressBar/progressBarAjax.jsf 1) 'cancel' Event Test (render=@all): JS error when clicking on Cancel button: In IE8: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E) Timestamp: Fri, 20 Jul 2012 17:15:52 UTC Message: Exception thrown and not caught Line: 1 Char: 16627 Code: 0 URI: http://localhost:8080/progressBar/javax.faces.resource/bridge.js.jsf?v=28218271 2) 'change' Event Test (render=@all) : same JS error when progressBar reaches the end. In Firefox and Chrome, for both tests the error in console is: Error: uncaught exception: cannot find enclosing form.
        Carmen Cristurean made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Ted Goddard added a comment -

        It looks like an ajax update is occurring for the element that is the source of the event. In the past we have resolved this with the following strategy:

        +++ src/main/javascript/application.js (working copy)
        @@ -108,6 +108,15 @@
        }

        function formOf(element) {
        + try

        { + return formOfNode(element); + }

        catch (e)

        { + //page update may have occurred + return formOfNode(document.getElementById(element.id)); + }

        + }
        +
        + function formOfNode(element)

        { return toLowerCase(element.nodeName) == 'form' ? element : enclosingForm(element); }

        This fixes the test case. In the past, DOM operations in the middle of ajax updates have been found to be highly browser-dependent.

        Show
        Ted Goddard added a comment - It looks like an ajax update is occurring for the element that is the source of the event. In the past we have resolved this with the following strategy: +++ src/main/javascript/application.js (working copy) @@ -108,6 +108,15 @@ } function formOf(element) { + try { + return formOfNode(element); + } catch (e) { + //page update may have occurred + return formOfNode(document.getElementById(element.id)); + } + } + + function formOfNode(element) { return toLowerCase(element.nodeName) == 'form' ? element : enclosingForm(element); } This fixes the test case. In the past, DOM operations in the middle of ajax updates have been found to be highly browser-dependent.
        Hide
        Ted Goddard added a comment -

        In the case of ICEmobile, the javax.faces.ViewState is missing from a failed button click, likely indicating that the ViewState was not "fixed" on the previous update, possibly due to a listener not being called.

        Show
        Ted Goddard added a comment - In the case of ICEmobile, the javax.faces.ViewState is missing from a failed button click, likely indicating that the ViewState was not "fixed" on the previous update, possibly due to a listener not being called.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30157 Fri Jul 20 15:52:41 MDT 2012 ted.goddard try element.id of formOf(element) fails (ICE-8372)
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/javascript/application.js
        Hide
        Ted Goddard added a comment -

        Fix for the double back button is being made in ICEmobile: MOBI-271.

        Show
        Ted Goddard added a comment - Fix for the double back button is being made in ICEmobile: MOBI-271 .
        Hide
        Ken Fyten added a comment -

        Carmen confirms that the specific tests that failed Thursday night (as per her comment "Carmen Cristurean added a comment - 20/Jul/12 01:15 PM" above), now pass with this patch in place. Complete regression tests will run Friday night, we'll have results on Monday morning.

        Show
        Ken Fyten added a comment - Carmen confirms that the specific tests that failed Thursday night (as per her comment "Carmen Cristurean added a comment - 20/Jul/12 01:15 PM" above), now pass with this patch in place. Complete regression tests will run Friday night, we'll have results on Monday morning.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30499 Tue Aug 14 16:40:01 MDT 2012 mircea.toma ICE-8465 Applied all the fixes for ICE-8372.
        Files Changed
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/core/src/main/javascript/submit.js
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/core/src/main/javascript/application.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30535 Thu Aug 16 14:30:21 MDT 2012 mircea.toma ICE-8468 Applied ICE-8372 fixes from trunk.
        Files Changed
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/core/src/main/javascript/application.js
        Hide
        Krashan Brahmanjara added a comment -

        Registered again as ICE-9129. I suppose many people has got problems with ice:panelPopup. After closing of this popup gui stops respond in some test cases.

        Show
        Krashan Brahmanjara added a comment - Registered again as ICE-9129 . I suppose many people has got problems with ice:panelPopup. After closing of this popup gui stops respond in some test cases.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Nils Lundquist
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: