Hi all,
i'm using fileUpload inside outputPanel. After the upload, the information of uploaded files disappears from list. Relevant code:
<a4j:outputPanel id="opUpload" ajaxRendered="true"> <rich:panel id="pnUpload" binding="#{testFileUpload.pnUpload}" /> </a4j:outputPanel>
public TestFileUpload() { FacesContext fc = FacesContext.getCurrentInstance(); this.pnUpload = new HtmlPanel(); this.pnUpload.setStyle("background-color: blue; width: 400px; margin-left: auto; margin-right: auto;"); HtmlFileUpload fu = new HtmlFileUpload(); fu.setMaxFilesQuantity(5); fu.setListHeight("100px"); fu.setListWidth("400px"); Application app = fc.getApplication(); ValueBinding vb = app.createValueBinding("#{testFileUpload.files}"); fu.setUploadData(vb); Class[] args1 = {UploadEvent.class}; MethodBinding mb3 = app.createMethodBinding("#{testFileUpload.listener}", args1); fu.setFileUploadListener(mb3); this.pnUpload.getChildren().add(fu); }
Hi,
Remove 'ajaxRendered' attribute from the ajax output panel.
In this case all output panel is rerendering after any ajax request.
So, fileUpload appears with empty files list.