rich:fileUpload does not work in IE6 and IE7 when error occ
xiaotao183 Jul 8, 2008 3:17 AMHi all,
I am trying to throw a IOException from the fileUpload backing bean and let the component catch it by handling onerror event. It was working correctly in firefox and safari but not in IE6 and IE7.
In IE6 and IE7, the fileUpload component displayed "done" message when the backing bean threw exception, and then redirected to the webapp home page with message "The conversation ended, timed out or was processing another request " (the home page is a default page when there is no conversation id specified)
In firefox and safari, the fileUpload component worked perfectly. it displayed "Transfer error occuried" and then executed the javaScript which is bound to onerror event.
The following are the richfaces code and backing bean code snippets
<rich:fileUpload id="signedFileUplaod" listHeight="50" fileUploadListener="#{signerManagement.uploadSignedFile}" cleanButtonClass="none" sizeErrorLabel="#{messages['upload.documents.upload.size.error.message']}" clearAllControlLabel="" clearControlLabel="" addControlLabel="#{messages['upload.documents.attach.signed.button.label']}" onerror="window.alert('something bad happened');"> <a4j:support event="onuploadcomplete" reRender="uploadButtonPanel" /> <f:facet name="label"> <h:outputText value="#{messages['upload.documents.upload.progress.message']}" /> </f:facet> </rich:fileUpload>
public void uploadSignedFile(UploadEvent event) throws IOException { if (event.getUploadItem().getFile() != null) { getLogger().info("uploaded signed document #0", event.getUploadItem().getFileName()); uploadedSignedDocument = fileService.constructDocumentByUploadItem(event.getUploadItem()); try { if (!signatureVerificationService.verify(uploadedSignedDocument)) { getLogger().info("The signed document #0 was not correctly signed", uploadedSignedDocument.getDocumentName()); uploadedSignedDocument = null; throw new IOException("The signed document was not correctly signed"); } } catch (IllegalArgumentException e) { getFacesMessages().add("The signed document was not correctly signed"); clear(); throw new IOException(e.getMessage()); } request.setSignedDocument(uploadedSignedDocument); } }
I am running richfaces 3.2.1.GA, seam 2.0.2.GA and jboss 4.2.2.GA
Thanks