Search code examples
jsffile-uploadrichfaces

File upload implementation using RichFaces 4.3.7


I am trying to add a file upload component in my application, I used Tomahawk, but it doesn't work with ajax which is essential in my case. So I used RichFaces, I add these jars to my lib folder :

  1. richfaces-core-api-4.3.7.Final.jar
  2. richfaces-core-impl-4.3.7.Final.jar
  3. richfaces-components-api-4.3.7.Final.jar
  4. richfaces-components-ui-4.3.7.Final.jar

    then I added this tag to my index.xhtml

    <rich:fileUpload fileUploadListener="#{createListBean.listner}" maxFilesQuantity="1" id="file" immediateUpload="false" acceptedTypes=".xls,.xlsx,.csv" allowFlash="false"> <a4j:ajax event="uploadcomplete" render=":contact-form:error_mess :contact form:records-form-table" /> </rich:fileUpload>

So my problem is there is an iframe appeared and also I can't find the upload button , and the css looks awful , all I need is an upload file input text and a button to upload with my own css on it. Thanks in advance


Solution

  • Try considering Primefaces Like this as it is Ajax enabled and very stable except IE 7. you can find many different file uploader like basic, multi, drag n drop, file filter, size limit