I am trying to upload files with file upload in primefaces 5.0, it works in simple mode but not in advanced mode. When I select a file to download it, the download button of the two buttons and the cancel button are still disabled, I leaked for a solution on the network, but did not find anything. please, help.
<h:form>
<p:fileUpload fileUploadListener="#{fileUpload.handleFileUpload}"
mode="advanced" dragDropSupport="false"
update="messages" sizeLimit="100000" fileLimit="3"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />
<p:growl id="messages" showDetail="true" />
</h:form>
@ManagedBean
public class FileUpload{
public void handleFileUpload(FileUploadEvent event) {
FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, message);
}
}
source
share