ICEfaces
  1. ICEfaces
  2. ICE-11416

ice:commandLink, javascript error on IE11 if <fieldset> is present

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: EE-3.3.0.GA_P05
    • Fix Version/s: EE-3.3.0.GA_P06
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Any

      Description

      The mere presence of a <fieldset> element (empty) causes a javascript error when using ice:commandLink with an action attribute. The error shown in the developer tools window is "Unable to get property 'indexOf' of undefined or null reference". This only occurs on IE11. It works fine on Chrome, Edge, and FF.

        Activity

        Hide
        Arturo Zambrano added a comment -

        Marking this issue as Won't Fix, as there's no need to fix anything in ICEfaces. The javascript error occurs in the JSF code, and there's a way to avoid it.

        The error occurs in the request() method in jsf.js, when the code goes through all the form elements, checking their 'name' attributes. The 'fieldset' element didn't get a 'name' attribute until HTML5, which doesn't seem to be well supported by IE11. So, IE11 throws an error because it cannot find a 'name' property on this empty 'fieldset' element that was added to the page.

        The workaround is to give a 'name' property to the 'fieldset' element, in order to avoid this error on IE11. However, simply adding a 'name' attribute in the markup doesn't work, because 'name' doesn't seem to be a recognized attribute for 'fieldset' on IE11. So, the solution is to give this element a 'name' property via Javascript. The following code accomplishes this.

        <fieldset id="fs1"></fieldset>
        <script type="text/javascript">document.getElementById('fs1').name='';</script>
        

        The value of the 'name' property can be the empty string. As long as there's a 'name' property on this object, the error won't occur.

        Show
        Arturo Zambrano added a comment - Marking this issue as Won't Fix, as there's no need to fix anything in ICEfaces. The javascript error occurs in the JSF code, and there's a way to avoid it. The error occurs in the request() method in jsf.js, when the code goes through all the form elements, checking their 'name' attributes. The 'fieldset' element didn't get a 'name' attribute until HTML5, which doesn't seem to be well supported by IE11. So, IE11 throws an error because it cannot find a 'name' property on this empty 'fieldset' element that was added to the page. The workaround is to give a 'name' property to the 'fieldset' element, in order to avoid this error on IE11. However, simply adding a 'name' attribute in the markup doesn't work, because 'name' doesn't seem to be a recognized attribute for 'fieldset' on IE11. So, the solution is to give this element a 'name' property via Javascript. The following code accomplishes this. <fieldset id= "fs1" ></fieldset> <script type= "text/javascript" >document.getElementById('fs1').name='';</script> The value of the 'name' property can be the empty string. As long as there's a 'name' property on this object, the error won't occur.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: