Open oikonomopo opened 5 years ago
I also have this issue. The status panel is not getting closed until we explicitly close it.
Found a temporary workaround! @TCellClinicalServices test if it works for you!
======= sample code (Fix: Close upload status window after all uploads finish)
...
private MultiFileUpload multiFileUpload;
private UploadStartedHandler uploadStartedHandler;
private UploadFinishedHandler uploadFinishedHandler;
private UploadStateWindow uploadStateWindow = new UploadStateWindow();
...
uploadStartedHandler = new UploadStartedHandler() {
@Override
public void handleUploadStarted() {
// enable Polling Interval to one second
// we need this or else upload status panel
// hangs at last upload frequently
// make the client browser poll the vaadin server, every 1 sec, for any UI changes.
// sets Polling Interval to 1 second
getUI().setPollInterval(1000);
}
};
...
multiFileUpload = new MultiFileUpload(uploadStartedHandler, uploadFinishedHandler, uploadStateWindow, true);
...
// after all uploads
multiFileUpload.setAllUploadFinishedHandler(new AllUploadFinishedHandler() {
@Override
public void finished() {
System.out.println("======= setAllUploadFinishedHandler");
filesHeaderListPanel.load(uploadedFiles);
// disable Polling Interval
getUI().setPollInterval(-1);
}
});
...
======== vaadin & vaadin-multifileupload addon versions
<vaadin.version>7.7.6</vaadin.version>
<dependency>
<groupId>com.wcs.wcslib</groupId>
<artifactId>wcslib-vaadin-widget-multifileupload</artifactId>
<version>2.0.3</version>
</dependency>
Thanks for the solution!
Thanks for the solution!
according @evanzel 's comment at #38 : we should restore also the poll interval in AllUploadFinishedHandler. Keep in mind that the bug still occurs sometimes, when Push is enabled.
The above code is working but for the first time when we upload a file, its not getting opened until an action is done on the screen.
The above code is working but for the first time when we upload a file, its not getting opened until an action is done on the screen.
_*I added the following code, not only in the component that uses the multi-upload component, but also on my "main" View component.
On your "main" View/Page, add on init/load method:
// make the client browser poll the vaadin server, every 1 sec, for any UI changes.
getUI().setPollInterval(1000);
And when leave current View disable it:
// disable Polling Interval
getUI().setPollInterval(-1);
Hi nice add-on!
======= vaadin-multifileupload Version I am using version 2.0.3
======= What it does now When i choose my files for upload, it open a popup dialog with upload status with progress bar for each file and cancel functionality. When uploading finishes the dialog closes.
======= What i want I would like after the file selections, instead of opening popup window (upload status / file upload progress bar etc), to skip this dialog and have just a spin/loading animation until upload finishes!