ICEfaces
  1. ICEfaces
  2. ICE-5685

Implement navigation notifier component or framework plug-in

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 3.1.0.BETA1, 3.1
    • Labels:
      None
    • Environment:
      browser/server
    • Assignee Priority:
      P1
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      In order to completely fix back/forward browser navigation problems that an AJAX application might encounter we need to provide a way of notifying the application when navigation occurred in the browser. This way the application can take steps to fix any state inconsistencies or rollback operations.

      In the browser http://code.google.com/p/reallysimplehistory/ library can be used since it provides all the functionality we need. Also the library has been updated regularly adding support along the time for all of our supported browsers.

        Activity

        Hide
        Ajay Sriramoju added a comment -

        After browsing through the issues going aroung the browser back/forward button, I was not able to find a working solution for browser back/forward button implementation using icefaces with RSH. I think it will be more appropriate to provide a working solution along with the procedure to implement RSH with icefaces, it would be great.

        Show
        Ajay Sriramoju added a comment - After browsing through the issues going aroung the browser back/forward button, I was not able to find a working solution for browser back/forward button implementation using icefaces with RSH. I think it will be more appropriate to provide a working solution along with the procedure to implement RSH with icefaces, it would be great.
        Hide
        Mircea Toma added a comment -

        Implemented navigation notifier component. The component is using RSH library to detected forward or back navigation. When the navigation detected the component will execute a postback that invoke the bean method registered with the 'action' binding of the navigationComponent.

        Show
        Mircea Toma added a comment - Implemented navigation notifier component. The component is using RSH library to detected forward or back navigation. When the navigation detected the component will execute a postback that invoke the bean method registered with the 'action' binding of the navigationComponent.
        Hide
        Mircea Toma added a comment -

        Added also 'navigationNotifier' test case under icefaces/samples/core/test directory.

        Show
        Mircea Toma added a comment - Added also 'navigationNotifier' test case under icefaces/samples/core/test directory.
        Hide
        Mircea Toma added a comment -
        Show
        Mircea Toma added a comment - Added Wiki documentation: http://wiki.icesoft.org/display/ICE/navigationNotifier .
        Hide
        Carmen Cristurean added a comment -

        Tested navigationNotifier in the new test application using ICEfaces3 trunk rev. 28992, and found the following issues:

        Firefox 12: 'Navigation detected!' message does not render when using 'back' browser navigation button.

        Chrome 18: 'Navigation detected!' message does not render when using any of the 'back' or 'forward' browser navigation buttons.
        When clicking the 'forward' browser button, a JS error is seen in console:
        [window] Error [status: malformedXML code: 200]: During update: vhz3as16-retrieve-update not found bridge.js.jsf;jsessionid=1588CA07FE5ABB81FC876205FE783B0A:1249

        IE8/7/9: 'Navigation detected!' message does not render when using any of the 'back' or 'forward' browser navigation buttons.
        When clicking the 'forward' browser button, a JS error message pops up:

        Webpage error details
        User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDS; .NET4.0C)
        Timestamp: Thu, 10 May 2012 18:09:53 UTC

        Message: 'id' is null or not an object
        Line: 1137
        Char: 5
        Code: 0
        URI: http://localhost:8080/navigationNotifier/javax.faces.resource/bridge.js.jsf;jsessionid=755F0097E2AC02F31C358C0F22A99972?v=1086865489

        Show
        Carmen Cristurean added a comment - Tested navigationNotifier in the new test application using ICEfaces3 trunk rev. 28992, and found the following issues: Firefox 12: 'Navigation detected!' message does not render when using 'back' browser navigation button. Chrome 18: 'Navigation detected!' message does not render when using any of the 'back' or 'forward' browser navigation buttons. When clicking the 'forward' browser button, a JS error is seen in console: [window] Error [status: malformedXML code: 200] : During update: vhz3as16-retrieve-update not found bridge.js.jsf;jsessionid=1588CA07FE5ABB81FC876205FE783B0A:1249 IE8/7/9: 'Navigation detected!' message does not render when using any of the 'back' or 'forward' browser navigation buttons. When clicking the 'forward' browser button, a JS error message pops up: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDS; .NET4.0C) Timestamp: Thu, 10 May 2012 18:09:53 UTC Message: 'id' is null or not an object Line: 1137 Char: 5 Code: 0 URI: http://localhost:8080/navigationNotifier/javax.faces.resource/bridge.js.jsf;jsessionid=755F0097E2AC02F31C358C0F22A99972?v=1086865489
        Hide
        Mircea Toma added a comment -

        Committed fix for IE browser, the identifier(element) function which returns the ID of the passed in element will now behave in IE the same way as in the other browsers. Previously it was throwing an exception if the argument is null.

        Show
        Mircea Toma added a comment - Committed fix for IE browser, the identifier(element) function which returns the ID of the passed in element will now behave in IE the same way as in the other browsers. Previously it was throwing an exception if the argument is null.
        Hide
        Mircea Toma added a comment -

        As for Firefox 12 and Chrome18, they both work as expected. Please re-test.

        Show
        Mircea Toma added a comment - As for Firefox 12 and Chrome18, they both work as expected. Please re-test.
        Hide
        Carmen Cristurean added a comment -

        Re-tested with ICEfaces3 trunk rev. 28998:
        IE JS errors have been resolved.
        For Firefox and Chrome, I probably misunderstood the way it should work, expecting to have the 'Navigation detected' message rendered on the page once when clicking the back button, and then again when clicking on the 'forward' button in the browser.

        Show
        Carmen Cristurean added a comment - Re-tested with ICEfaces3 trunk rev. 28998: IE JS errors have been resolved. For Firefox and Chrome, I probably misunderstood the way it should work, expecting to have the 'Navigation detected' message rendered on the page once when clicking the back button, and then again when clicking on the 'forward' button in the browser.
        Hide
        Carmen Cristurean added a comment - - edited

        For Firefox and Chrome, only the first time when the browser cache is cleared, there is still an error seen in the error console, when clicking on the 'forward' button in the browser.

        The message in Firefox 12 is:
        Timestamp: 10/05/2012 5:06:29 PM
        Error: attempt to run compile-and-go script on a cleared scope
        Source File: http://localhost:8080/navigationNotifier/javax.faces.resource/jsf.js.jsf;jsessionid=451B48F2469AFCFF7B13579D219E212D?ln=javax.faces&stage=Development&v=1700203556
        Line: 2076

        Show
        Carmen Cristurean added a comment - - edited For Firefox and Chrome, only the first time when the browser cache is cleared, there is still an error seen in the error console, when clicking on the 'forward' button in the browser. The message in Firefox 12 is: Timestamp: 10/05/2012 5:06:29 PM Error: attempt to run compile-and-go script on a cleared scope Source File: http://localhost:8080/navigationNotifier/javax.faces.resource/jsf.js.jsf;jsessionid=451B48F2469AFCFF7B13579D219E212D?ln=javax.faces&stage=Development&v=1700203556 Line: 2076
        Hide
        Mircea Toma added a comment -

        Are you always seeing the error? I do se this error from time to time in other use cases. I think this is Firefox+Firebug error, most probably it does not occur wen Firebug is disabled. There's also this: https://bugzilla.mozilla.org/show_bug.cgi?id=635548 .

        Show
        Mircea Toma added a comment - Are you always seeing the error? I do se this error from time to time in other use cases. I think this is Firefox+Firebug error, most probably it does not occur wen Firebug is disabled. There's also this: https://bugzilla.mozilla.org/show_bug.cgi?id=635548 .
        Hide
        Mircea Toma added a comment -

        The error occurs when the browser doesn't use the session tracking cookie (as mentioned already). Also RSH library uses document.write function to insert an element into the document, when the browser doesn't have a session setup yet FF will throw the mentioned error.

        Show
        Mircea Toma added a comment - The error occurs when the browser doesn't use the session tracking cookie (as mentioned already). Also RSH library uses document.write function to insert an element into the document, when the browser doesn't have a session setup yet FF will throw the mentioned error.
        Hide
        Mircea Toma added a comment -

        Attached patch that replaces the 'document.write' element inserting done by RSH with the component rendering the elements instead. This gets rid of the JS error but the RSH won't be able to detect the browser navigation until the cookie based session is not established.

        Show
        Mircea Toma added a comment - Attached patch that replaces the 'document.write' element inserting done by RSH with the component rendering the elements instead. This gets rid of the JS error but the RSH won't be able to detect the browser navigation until the cookie based session is not established.
        Hide
        Ken Fyten added a comment -

        The FF limitation will be documented as a Known Issue.

        Show
        Ken Fyten added a comment - The FF limitation will be documented as a Known Issue.
        Hide
        Mircea Toma added a comment -

        Applied attached patched.

        Show
        Mircea Toma added a comment - Applied attached patched.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            12 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: