ICEfaces
  1. ICEfaces
  2. ICE-10929

Myfaces specific ace:fileEntry js error when adding row to dataTable

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: EE-4.0.0.GA
    • Fix Version/s: EE-4.1.0.GA
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tomcat 8, Myfaces libs, all browsers
    • Assignee Priority:
      P2
    • Workaround Description:
      Hide
      There are two possible workarounds:
      1) Keep the upload form exclusively for uploading. All other actions should be done in a separate form or forms.
      2) Add the enctype="multipart/form-data" attribute-value to the form.
      Show
      There are two possible workarounds: 1) Keep the upload form exclusively for uploading. All other actions should be done in a separate form or forms. 2) Add the enctype="multipart/form-data" attribute-value to the form.

      Description

      When using myfaces libs and the ace:fileEntry Add row to top or bottom of table apps there is a js console error when using the Add button. This error occurs whether or not the multipart-config is added to the web.xml.
      Screen shot of console error is included as there is no description.
      To reproduce:
      Build ace:fileEntry with myfaces libs.
      Use the /fileEntryTableTop.jsf application found at:
      http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/fileEntry
      Open the browser console and press the Add button.

        Activity

        Hide
        Arturo Zambrano added a comment -

        r44589: modified test app: moved 'add' button to a separate form

        Regardless of which operation was being done, MyFaces was complaining for every request done inside a form that contained <input type="file"/> elements for not being a multipart form. The message I got was "Uncaught clientError: The form with the id frm has an input file element, but is not a multipart form". Even a plain h:commandButton with ajax and no actionListener was causing this issue. The operation done by the listener (i.e. adding a new row) was being performed normally however.

        The way ace:fileEntry works is to hijack the request and makes it a multipart request dynamically. Of course, MyFaces doesn't know this and will complain about it. This is just MyFaces behaviour and nothing much can be done about it except for having the ace:fileEntry component(s) in an exclusive form where no other kinds of requests take place. We have already been recommending this practice.

        Another option would be to simply specify the enctype="multipart/form-data" attribute in the form to prevent MyFaces from complaining.

        Show
        Arturo Zambrano added a comment - r44589: modified test app: moved 'add' button to a separate form Regardless of which operation was being done, MyFaces was complaining for every request done inside a form that contained <input type="file"/> elements for not being a multipart form. The message I got was "Uncaught clientError: The form with the id frm has an input file element, but is not a multipart form". Even a plain h:commandButton with ajax and no actionListener was causing this issue. The operation done by the listener (i.e. adding a new row) was being performed normally however. The way ace:fileEntry works is to hijack the request and makes it a multipart request dynamically. Of course, MyFaces doesn't know this and will complain about it. This is just MyFaces behaviour and nothing much can be done about it except for having the ace:fileEntry component(s) in an exclusive form where no other kinds of requests take place. We have already been recommending this practice. Another option would be to simply specify the enctype="multipart/form-data" attribute in the form to prevent MyFaces from complaining.
        Hide
        Arturo Zambrano added a comment -

        Closing as Won't Fix. Workarounds will be documented.

        Show
        Arturo Zambrano added a comment - Closing as Won't Fix. Workarounds will be documented.
        Hide
        Liana Munroe added a comment -

        Verified workarounds, ICEfaces 4 trunk, EE-3.3.0 maintenance branch, Tomcat 8, IE 11, 10, 9, 8, 7, FF 43, Chrome 48.

        Show
        Liana Munroe added a comment - Verified workarounds, ICEfaces 4 trunk, EE-3.3.0 maintenance branch, Tomcat 8, IE 11, 10, 9, 8, 7, FF 43, Chrome 48.
        Hide
        Ken Fyten added a comment -

        Documented the myfaces workarounds in the Known Issues section of the http://www.icesoft.org/wiki/display/ICE/FileEntry wiki topic.

        Show
        Ken Fyten added a comment - Documented the myfaces workarounds in the Known Issues section of the http://www.icesoft.org/wiki/display/ICE/FileEntry wiki topic.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Liana Munroe
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: