I am using primefaces 3.4.2.
I am trying to upload multiple files but selected once per selection, but the listener is called for the first file and listener is not called for the other files in the row.
What might be causing this problem?
This is the related part of jsf page
<p:dialog id="uploadNcstFileDialog" closable="true"
widgetVar="uploadFileWidget" header="file Upload" modal="true"
resizable="false">
<h:form id="uploadFileForm" prependId="false"
enctype="multipart/form-data">
<h:outputLabel value="Choose a file to upload" />
<p:panel style="width:600px;height:200px;">
<p:fileUpload
fileUploadListener="#{bulkSmsMainBean.handleFileUpload}"
mode="advanced" uploadLabel="Upload" cancelLabel="Stop"
label="Dosya Seç" allowTypes="/(\.|\/)(pdf|gif|jpe?g|doc(x)?|xls(x)?|msg)$/"
invalidFileMessage="#{msgs['docformat.error']}"
update=":bulkSmsDetailTabs:bulkSmsDocumentListForm:documentListDataTableId" />
<p:commandButton styleClass="button-type4"
style="float:right;margin-top:22px" value="Cancel" position="right"
onclick="uploadFileWidget.hide();return false;" />
</p:panel>
</h:form>
</p:dialog>
This is the listener
public void handleFileUpload(FileUploadEvent event) {
UploadedFile uploadedFile = event.getFile();
String fileName = uploadedFile.getFileName();
int pos = fileName.lastIndexOf('.');
String ext = fileName.substring(pos + 1);
if (uploadedFile.getFileName().contains("\\")) {
fileName = fileName.substring(fileName.lastIndexOf('\\', fileName.length()) + 1);
}
loadDocumentList();
}