FileUpload does not load the listener in JSF 2.2

2

I am migrating a project to JEE7 from PrimeFaces 3.5 to 5.0 and I have a problem with FileUpload. It does not load the file in the JSF 2.2 event listener.

Follow the xhtml code:

<p:fileUpload id="import" value="#{fileBean.file}" mode="single" 
    label="#{msg.procurar}" 
    auto="true" fileUploadListener="#{fileBean.handleFileUpload}"
    invalidFileMessage="#{msg.somente_excel}"
    allowTypes="/(\.|\/)(xls|xlsx)$/" />

Follow the bean:

public void handleFileUpload(FileUploadEvent event) throws IOException {
      this.uploadedFile = event.getFile();
}

Does anyone have any idea why the event is not being triggered? Has JSF2.2 changed any configuration or ownership?

    
asked by anonymous 08.05.2017 / 22:21

1 answer

3

In addition, the mode is wrong, you have put single , but the right one is simple     

12.07.2017 / 13:53