FileUpload event update errors in IE9: XML5632: only one root element is allowed

file uploadinternet-explorer-9jsfprimefaces

I am using the <p:fileUpload> component of PrimeFaces. After the upload, I have an event "update". With Chrome and Firefox, the update event is fired, but with Internet Explorer (IE9), it isn't. It shows the following error:

XML5632: only one root element is allowed.

How is this caused and how can I solve it? I am using PF 3.0 Final (downloaded two or three weeks ago), Mojarra 2.1.3, GlassFish 3.1.

Best Answer

I have find a temporary solution.

It's to not use the event update, but an <p:remoteCommand>.

Like this :

<h:form enctype="multipart/form-data">
    <p:fileUpload auto="true" 
              label="Choisir..." 
              mode="advanced" 
              oncomplete="remoteCommandUpdateDataTable()"
              fileUploadListener="#{uploadBean.handleFileUpload}">
            <f:attribute name="evidence" value="#{evidence}"/>
    </p:fileUpload>
    <p:remoteCommand name="remoteCommandUpdateDataTable" update="myDataTable"/>
</h:form>

And it is the same think like update but it works with Chrome, Firefox and IE !

Related Topic