diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VUpload.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VUpload.java b/client/src/main/java/com/vaadin/client/ui/VUpload.java index 56532b4a19..2f4b62a47f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUpload.java +++ b/client/src/main/java/com/vaadin/client/ui/VUpload.java @@ -121,6 +121,8 @@ public class VUpload extends SimplePanel { private boolean immediateMode; + private String acceptMimeTypes; + private Hidden maxfilesize = new Hidden(); /** For internal use only. May be removed or replaced in the future. */ @@ -254,6 +256,9 @@ public class VUpload extends SimplePanel { fu = new VFileUpload(); fu.setName(paintableId + "_file"); fu.getElement().setPropertyBoolean("disabled", !enabled); + if (acceptMimeTypes != null && !acceptMimeTypes.isEmpty()) { + InputElement.as(fu.getElement()).setAccept(acceptMimeTypes); + } panel.add(fu); panel.add(submitButton); if (isImmediateMode()) { @@ -424,5 +429,6 @@ public class VUpload extends SimplePanel { } else { InputElement.as(fu.getElement()).setAccept(acceptMimeTypes); } + this.acceptMimeTypes = acceptMimeTypes; } } |