aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2018-06-18 13:28:07 +0200
committerGitHub <noreply@github.com>2018-06-18 13:28:07 +0200
commit4608a53c7acaeb46f4f6c89c3f81b2b7e6248164 (patch)
treef03efecb18be7eaf10f89ef587dfa024f422f7cd /client
parentb8ed19d5e5597ebb82a4cdd53a941ca4dd06065f (diff)
downloadvaadin-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.java9
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);
+ }
+ }
}