I've got a basic form with a fileUpload in it. I want that the upload start when the user click on the submit button of the form.
So I've implemented that like this :
Code: Select all
<h:form id="fileTransfertView1UploadForm" prependId="false">
<h:panelGrid columns="2">
<h:outputLabel value="#{messages['file1']} :" for="fileTransfertView1UploadFormfile1"/>
<p:fileUpload widgetVar="widgetVar" id="fileTransfertView1UploadFormfile1" label="#{messages['file1']}:" fileUploadListener="#{fileTransfertTestControler.uploadFile1}" customUI="true"/>
</h:panelGrid>
<p:commandButton id="fileTransfertView1UploadAction" value="#{messages['upload']}" action="#{fileTransfertTestControler.fileTransfertView1Upload}"
onclick="widgetVar.upload();" ajax="true" update="messagesDialog, fileTransfertView1UploadForm"/>
</h:form>
Is there a way to make the upload synchrone (ie : widgetVar.upload() returns when upload is complete) ?
Thank's for any help.