diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2018-06-18 13:28:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-18 13:28:07 +0200 |
commit | 4608a53c7acaeb46f4f6c89c3f81b2b7e6248164 (patch) | |
tree | f03efecb18be7eaf10f89ef587dfa024f422f7cd /client | |
parent | b8ed19d5e5597ebb82a4cdd53a941ca4dd06065f (diff) | |
download | vaadin-framework-4608a53c7acaeb46f4f6c89c3f81b2b7e6248164.tar.gz vaadin-framework-4608a53c7acaeb46f4f6c89c3f81b2b7e6248164.zip |
Add ACCEPT attribute to Upload (#10906)
Fixes #2410
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VUpload.java | 9 |
1 files changed, 9 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 ad50ca3115..681eaaf2f2 100644 --- a/client/src/main/java/com/vaadin/client/ui/VUpload.java +++ b/client/src/main/java/com/vaadin/client/ui/VUpload.java @@ -25,6 +25,7 @@ import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.FormElement; +import com.google.gwt.dom.client.InputElement; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.FileUpload; @@ -405,4 +406,12 @@ public class VUpload extends SimplePanel { private static Logger getLogger() { return Logger.getLogger(VUpload.class.getName()); } + + public void setAcceptMimeTypes(String acceptMimeTypes) { + if (acceptMimeTypes == null || acceptMimeTypes.isEmpty()) { + InputElement.as(fu.getElement()).setAccept(null); + } else { + InputElement.as(fu.getElement()).setAccept(acceptMimeTypes); + } + } } |