ICEfaces
  1. ICEfaces
  2. ICE-7139

Component ice:commandLink - throws JS error "object doesn't support this property or method" in IE 8

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 3.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      IE 8.0.7600 on Windows 7, and IE 8.0.6001 on Windows XP; tomcat7

      Description

      There is a JS error "object doesn't support this property or method" when clicking on the link to load the second page.
      Attached the test case war file built for Tomcat 7, and attached screen shot of the error in IE 8.


      The code is here:
      <html
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:ice="http://www.icesoft.com/icefaces/component" >
       <ui:composition template="/templates/Master.xhtml">
         <ui:define name="content">
           <h:form>
            <ice:commandLink action="/pages/Main.xhtml" value="logon" />
           </h:form>
         </ui:define>
       </ui:composition>
       </html>

        Activity

        Carmen Cristurean created issue -
        Carmen Cristurean made changes -
        Field Original Value New Value
        Attachment forum-ie8-arae.war [ 13442 ]
        Attachment testIE8.jpg [ 13443 ]
        Hide
        Ken Fyten added a comment -

        This seems to be related to using navigation. When the same app. is tested using redirect navigation, the error doesn't occur.

        Show
        Ken Fyten added a comment - This seems to be related to using navigation. When the same app. is tested using redirect navigation, the error doesn't occur.
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s 2.1 [ 10241 ]
        Assignee Priority P2
        Assignee Mircea Toma [ mircea.toma ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P2 P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25291 Mon Aug 22 07:56:36 MDT 2011 mircea.toma ICE-7139 Make sure that only the code is passed into the 'eval' function without additional parameters.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/fixjsf.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25292 Mon Aug 22 08:02:26 MDT 2011 mircea.toma ICE-7139 Check first if the title exists in the update before trying to extract the title content.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/fixjsf.js
        Hide
        Mircea Toma added a comment -

        First error found with the test case occurs at line bridge.js:312 just as in the attached screenshot. The message was different since I could reproduce it only with FF. The problem seems to occur when iterating over a collection of script strings with the 'eval' function passed in as the iterator. The iterator would receive the code (as string) and the index of the string, at this point the JS interpreter would complain about the second parameter passed into the 'eval' function.

        The fix applied makes sure that only the code is passed into the 'eval' function without additional parameters.

        Show
        Mircea Toma added a comment - First error found with the test case occurs at line bridge.js:312 just as in the attached screenshot. The message was different since I could reproduce it only with FF. The problem seems to occur when iterating over a collection of script strings with the 'eval' function passed in as the iterator. The iterator would receive the code (as string) and the index of the string, at this point the JS interpreter would complain about the second parameter passed into the 'eval' function. The fix applied makes sure that only the code is passed into the 'eval' function without additional parameters.
        Hide
        Mircea Toma added a comment -

        The second occurs while the DOM update is applied to the entire document. The update/document does not contain a title which causes the bridge code to fail while trying to extract the title from the update.

        The fix applied checks first if the title exists before trying to extract the title content.

        Show
        Mircea Toma added a comment - The second occurs while the DOM update is applied to the entire document. The update/document does not contain a title which causes the bridge code to fail while trying to extract the title from the update. The fix applied checks first if the title exists before trying to extract the title content.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Deryk Sinotte added a comment -

        I'm finding jsp:forward is still failing for me but only if you close IE, clear the cache, and open it fresh again and then it only fails the first time with the original JS error that was reported.

        Show
        Deryk Sinotte added a comment - I'm finding jsp:forward is still failing for me but only if you close IE, clear the cache, and open it fresh again and then it only fails the first time with the original JS error that was reported.
        Deryk Sinotte made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Deryk Sinotte added a comment -

        Just to add my observations and notes. I saw the same reported error in the IE8 developer tools as reported originally. The error occurs in the Sizzle CSS library included with Prototype when it calls
        Event.observe(window, 'load', fireContentLoadedEvent);

        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.4506.2152; .NET CLR 3.5.30729)
        Timestamp: Mon, 22 Aug 2011 18:18:28 UTC

        Message: Object doesn't support this property or method
        Line: 312
        Char: 36
        Code: 0
        URI: http://192.168.55.107:8080/forum-ie8-arae/faces/javax.faces.resource/bridge.js;jsessionid=22842289F38D96A6B84B35BBAFE65154?rand=629435653

        The problem occurs when:

        • using IE8 (works fine with IE9 and non-IE browsers)
        • navigation occurs that causes a ViewRoot update (so eval all the associated scripts again)
        • it only happens immediately after IE8 has been started (it fails the first time but seems to work fine after that - presume a cached version of some resource is now working)
        • depends on how you access the first page the first time:
        • response.sendRedirect("faces/pages/Start.xhtml") works
        • <jsp:forward page="faces/pages/Start.xhtml" /> does not work
        • http://192.168.55.107:8080/forum-ie8/faces/pages/Start.xhtml does not work
          (at one point, it appeared that the FacesServlet mapping being set to /faces/* rather than *.jsf had some effect but the method of loading the first page is actually the real key)
        Show
        Deryk Sinotte added a comment - Just to add my observations and notes. I saw the same reported error in the IE8 developer tools as reported originally. The error occurs in the Sizzle CSS library included with Prototype when it calls Event.observe(window, 'load', fireContentLoadedEvent); 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.4506.2152; .NET CLR 3.5.30729) Timestamp: Mon, 22 Aug 2011 18:18:28 UTC Message: Object doesn't support this property or method Line: 312 Char: 36 Code: 0 URI: http://192.168.55.107:8080/forum-ie8-arae/faces/javax.faces.resource/bridge.js;jsessionid=22842289F38D96A6B84B35BBAFE65154?rand=629435653 The problem occurs when: using IE8 (works fine with IE9 and non-IE browsers) navigation occurs that causes a ViewRoot update (so eval all the associated scripts again) it only happens immediately after IE8 has been started (it fails the first time but seems to work fine after that - presume a cached version of some resource is now working) depends on how you access the first page the first time: response.sendRedirect("faces/pages/Start.xhtml") works <jsp:forward page="faces/pages/Start.xhtml" /> does not work http://192.168.55.107:8080/forum-ie8/faces/pages/Start.xhtml does not work (at one point, it appeared that the FacesServlet mapping being set to /faces/* rather than *.jsf had some effect but the method of loading the first page is actually the real key)
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25379 Thu Sep 01 09:16:47 MDT 2011 mircea.toma ICE-7139 Evaluate inline and referenced scripts in the global context to avoid capturing private function or variable definitions.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/fixjsf.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25380 Thu Sep 01 09:24:49 MDT 2011 mircea.toma ICE-7139 Remove useless return.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/fixjsf.js
        Hide
        Mircea Toma added a comment -

        When navigation is triggered an update is received for the entire document. The bridge will fetch the referenced scripts and evaluate them along with the inlined scripts.
        When Prototype code is evaluated the context of evaluation is the one where the 'eval' function is invoked, context that has an Event variable already defined that differs from the global Event variable .

        To fix the issue globalEval function was introduced which will evaluate inline and referenced scripts in the global context to avoid capturing private function or variable definitions.

        Show
        Mircea Toma added a comment - When navigation is triggered an update is received for the entire document. The bridge will fetch the referenced scripts and evaluate them along with the inlined scripts. When Prototype code is evaluated the context of evaluation is the one where the 'eval' function is invoked, context that has an Event variable already defined that differs from the global Event variable . To fix the issue globalEval function was introduced which will evaluate inline and referenced scripts in the global context to avoid capturing private function or variable definitions.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #25391 Thu Sep 01 17:26:21 MDT 2011 mircea.toma ICE-7139 Select for evaluation only non-empty strings.
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/core/src/main/javascript/fixjsf.js
        Hide
        Carmen Cristurean added a comment -

        This fix has been verified using trunk code rev. #25404, on tomcat 7, and browsers: IE8, Firefox 6.1, Google Chrome 13.
        Closing the issue.

        Show
        Carmen Cristurean added a comment - This fix has been verified using trunk code rev. #25404, on tomcat 7, and browsers: IE8, Firefox 6.1, Google Chrome 13. Closing the issue.
        Carmen Cristurean made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Ken Fyten made changes -
        Link This issue blocks ICE-7192 [ ICE-7192 ]
        Hide
        Marco Fuenzalida added a comment -

        hi, my name is mark and have this problem, but i solutions. the solution is....
        quit the <ice: inputs> and replace for <h:inputs> this way functions perfect... bridge is the problem, but this form is solution
        good luck..
        good bye.-

        Show
        Marco Fuenzalida added a comment - hi, my name is mark and have this problem, but i solutions. the solution is.... quit the <ice: inputs> and replace for <h:inputs> this way functions perfect... bridge is the problem, but this form is solution good luck.. good bye.-

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Carmen Cristurean
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: