From 240cdce985bfc08a6e2869d1de52718227706640 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 3 Apr 2020 13:24:11 +0300 Subject: Prevent upload if no file is selected. (#11939) Fixes #10419 --- server/src/main/java/com/vaadin/ui/Upload.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'server') diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 018b06e581..de2d520438 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -1038,21 +1038,20 @@ public class Upload extends AbstractComponent } /** - * Forces the upload the send selected file to the server. + * Instructs the upload component to send selected file to the server. *

* In case developer wants to use this feature, he/she will most probably - * want to hide the uploads internal submit button by setting its caption to - * null with {@link #setButtonCaption(String)} method. + * want to hide the upload component's internal submit button by setting its + * caption to null with {@link #setButtonCaption(String)} method. *

- * Note, that the upload runs asynchronous. Developer should use normal - * upload listeners to trac the process of upload. If the field is empty - * uploaded the file name will be empty string and file length 0 in the - * upload finished event. + * Note that the upload runs asynchronously. Developer should use normal + * upload listeners to track the process of upload. If the file name field + * is empty, no upload will be triggered. *

- * Also note, that the developer should not remove or modify the upload in - * the same user transaction where the upload submit is requested. The - * upload may safely be hidden or removed once the upload started event is - * fired. + * Also note that the developer should not remove or modify the upload + * component in the same user transaction where the upload submit is + * requested. The upload component can be safely hidden or removed once the + * upload started event has been fired. */ public void submitUpload() { markAsDirty(); -- cgit v1.2.3