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

        Mircea Toma created issue -
        Mircea Toma made changes -
        Field Original Value New Value
        Assignee Mircea Toma [ mircea.toma ]
        Mircea Toma made changes -
        Salesforce Case []
        Fix Version/s 2.0-Beta [ 10231 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.1 [ 10241 ]
        Fix Version/s 2.0-Beta [ 10231 ]
        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.
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2 P3
        Ken Fyten made changes -
        Fix Version/s 3.1 [ 10312 ]
        Fix Version/s 3.0 [ 10241 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P3 P2
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 3.1.0.BETA1 [ 10335 ]
        Affects [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28975 Wed May 09 08:10:13 MDT 2012 mircea.toma ICE-5685 Added test case.
        Files Changed
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java/org/icefaces
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/index.html
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/test.xhtml
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/build.xml
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java/org/icefaces/demo/navigationNotifier
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java/org
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java/org/icefaces/demo/navigationNotifier/TestBean.java
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/WEB-INF/web.xml
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/java/org/icefaces/demo
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/WEB-INF/faces-config.xml
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/resources
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier
        Commit graph ADD /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/WEB-INF
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28976 Wed May 09 08:55:36 MDT 2012 mircea.toma ICE-5685 Implemented navigation notifier.
        Files Changed
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/navigation-notifier/json2007.js
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/navigation-notifier/blank.html
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/core.taglib.xml
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/component/NavigationNotifier.java
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/navigation-notifier
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/navigation-notifier/rsh.js
        Commit graph ADD /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/component/NavigationNotifierHandler.java
        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.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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
        Carmen Cristurean made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2 P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28994 Thu May 10 14:44:21 MDT 2012 mircea.toma ICE-5685 Normalize the return of the 'identifier' function for IE as well.
        Files Changed
        Commit graph MODIFY /projects/bridge-support/src/main/javascript/element.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28995 Thu May 10 14:46:02 MDT 2012 mircea.toma ICE-5685 Add hyperlink that points back to the index page to help with the 'back' navigation testing.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/core/test/navigationNotifier/src/main/webapp/test.xhtml
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #28996 Thu May 10 14:48:07 MDT 2012 mircea.toma ICE-5685 Replace the submitting element, formerly a 'span', with a hidden 'input' element to avoid any problem with form serialization.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/component/NavigationNotifier.java
        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.
        Mircea Toma made changes -
        Attachment ICE-5685.patch [ 14415 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29050 Tue May 15 15:43:22 MDT 2012 mircea.toma ICE-5685 Replace the 'document.write' element inserting done by RSH with the component rendering of the elements instead.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/component/NavigationNotifier.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/resources/META-INF/resources/navigation-notifier/rsh.js
        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.
        Ken Fyten made changes -
        Salesforce Case []
        Affects [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial] [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration]
        Hide
        Mircea Toma added a comment -

        Applied attached patched.

        Show
        Mircea Toma added a comment - Applied attached patched.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: