Reputation: 416
I have a Vaadin DragAndDropEvent from here but there's something weird about the progress indicator
@Override
public boolean listenProgress() {return true;}
@Override
public void onProgress(final StreamingProgressEvent event) {
Notification.show("De upload is bezig", Notification.Type.WARNING_MESSAGE);
}
Could someone explain me where I need to put my Notification so that the notification is showed when the upload is in progress and not when it's done?
Upvotes: 1
Views: 161
Reputation: 4634
TLDR: put UI.getCurrent().setPollInterval(10)
before your progress = new ProgressIndicator();
line or enable Push Mode.
There are 2 solutions to this problem. You can either stick to ProgressIndicator
which is used in your sample or use brand new ProgressBar together with Push Mode.
@Deprecated
Deprecated. as of 7.1, use ProgressBar combined with UI.setPushMode(PushMode) or UI.setPollInterval(int) instead.
your code does not work because your poll interval is higher (or disabled at all) than time needed for transfer the file.
Upvotes: 2