ICEfaces
  1. ICEfaces
  2. ICE-6681

Navigation in preRenderView event throws Error in extras bootstrap JavaScript exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.0-EE-Beta1
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      IE and Firefox
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use a PhaseListener instead, this has been implemented in attached test case but had been commented out to show original issue.

      Description

      When using the following code:

      <f:metadata>
                  <f:event type="preRenderView" id="prePayDayApproveEvent" listener="#{testBean.someAction}"/>
      </f:metadata>

      A forward navigation takes place in the event listener. The navigation is causing a JavaScript error to be thrown. See attachments for details.

        Activity

        Arran Mccullough created issue -
        Hide
        Arran Mccullough added a comment -

        Attached test case war file built for Tomcat 6. Attached screen shots of the errors in Firefox.

        Show
        Arran Mccullough added a comment - Attached test case war file built for Tomcat 6. Attached screen shots of the errors in Firefox.
        Arran Mccullough made changes -
        Field Original Value New Value
        Attachment Case9915Example.war [ 12994 ]
        Attachment js-error-bootstrap.JPG [ 12995 ]
        Attachment firebug-error.JPG [ 12996 ]
        Arran Mccullough made changes -
        Attachment Case9915Example.zip [ 12997 ]
        Arran Mccullough made changes -
        Salesforce Case [5007000000GBZTT]
        Arran Mccullough made changes -
        Workaround Description Use a PhaseListener instead Use a PhaseListener instead, this has been implemented in attached test case but had been commented out to show original issue.
        Ken Fyten made changes -
        Fix Version/s 2.1 [ 10241 ]
        Assignee Priority P2
        Assignee Mircea Toma [ mircea.toma ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24919 Tue Jun 28 14:54:24 MDT 2011 mircea.toma ICE-6681 Modify HeadBodyListener to be invoked on view root pre-rendering just before BridgeSetup runs to allow the inspection of the component tree. Test for the existence of h:head and h:body components in the component tree by iterating through the view root children. Changed BridgeSetup and ExtrasSetup to be invoked on view root component pre-render event instead pre-render view.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/HeadBodyListener.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml
        Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/application/ExtrasSetup.java
        Commit graph MODIFY /icefaces2/trunk/icefaces/compat/component-metadata/src/main/resources/com/icesoft/jsfmeta/templates/jsf11/resources/faces-config-rt.ftl
        Commit graph MODIFY /icefaces2/trunk/icefaces/compat/core/src/main/resources/META-INF/faces-config.xml
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/BridgeSetup.java
        Hide
        Mircea Toma added a comment -

        Looks like the h:head and h:body detection fails during the initial forward navigation which causes the BridgeSetup to give up on rendering the script tags that load the core bridge code, only the compat JS code being loaded.

        Show
        Mircea Toma added a comment - Looks like the h:head and h:body detection fails during the initial forward navigation which causes the BridgeSetup to give up on rendering the script tags that load the core bridge code, only the compat JS code being loaded.
        Hide
        Mircea Toma added a comment -

        The HeadBodyListener is not invoked during the processing of the second view (navigated to) because the PreAddComponentEvent is not fired at that time.

        Show
        Mircea Toma added a comment - The HeadBodyListener is not invoked during the processing of the second view (navigated to) because the PreAddComponentEvent is not fired at that time.
        Hide
        Mircea Toma added a comment - - edited

        The fix modifies the HeadBodyListener to be invoked on view root component pre-rendering just before BridgeSetup runs to allow the inspection of the component tree. Changed the test for the existence of h:head and h:body components in the component tree to iterate through the view root children. Changed BridgeSetup and ExtrasSetup to be invoked on view root component pre-render event instead pre-render view so that they're invoked after HeadBodyListener does its tests.

        Show
        Mircea Toma added a comment - - edited The fix modifies the HeadBodyListener to be invoked on view root component pre-rendering just before BridgeSetup runs to allow the inspection of the component tree. Changed the test for the existence of h:head and h:body components in the component tree to iterate through the view root children. Changed BridgeSetup and ExtrasSetup to be invoked on view root component pre-render event instead pre-render view so that they're invoked after HeadBodyListener does its tests.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carmen Cristurean made changes -
        Assignee Mircea Toma [ mircea.toma ] Carmen Cristurean [ ccristurean ]
        Hide
        Carmen Cristurean added a comment -

        Tested successfully on Icefaces2.1 trunk (revision#24992), using Tomcat6 server and FF3.6 and IE8 browsers.

        Show
        Carmen Cristurean added a comment - Tested successfully on Icefaces2.1 trunk (revision#24992), using Tomcat6 server and FF3.6 and IE8 browsers.
        Carmen Cristurean made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Carmen Cristurean
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: