FileUpload
FileUpload is the simplified version of the PrimeFaces advanced uploader in core. Uploader is disabled in online demo.
Mobile Showcase
MenuFileUpload is the simplified version of the PrimeFaces advanced uploader in core. Uploader is disabled in online demo.
<h:form enctype="multipart/form-data"> <p:growl showDetail="true"/> <p:fileUpload value="#{fileUploadView.file}" mode="simple" disabled="true"/> <p:commandButton value="Upload" icon="ui-icon-arrow-u" ajax="false" actionListener="#{fileUploadView.upload}" disabled="true"/> </h:form>
package org.primefaces.showcase.view.file; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; import org.primefaces.model.UploadedFile; @ManagedBean public class FileUploadView { private UploadedFile file; public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public void upload() { if(file != null) { FacesMessage message = new FacesMessage("Succesful", file.getFileName() + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, message); } } }
Running: PrimeFaces-Mobile-12.0 / PrimeFaces-12.0.0 on Mojarra-2.3.8 with OmniFaces 3.11.1 and jQuery v3.3.1 / jQuery Mobile 1.5.0-rc1