From 3e9e19fc57b963e8a2e6c0d3c9a1bdafbc8e4b04 Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Sun, 12 Oct 2014 23:42:28 +0300 Subject: Set v-disabled on Button inside Upload when disabled. (#14655) Change-Id: Ic28c8e4020eddae32a71b5c7f9da0ad61f2f7af9 --- client/src/com/vaadin/client/ui/VUpload.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/VUpload.java b/client/src/com/vaadin/client/ui/VUpload.java index f234ef6d65..42fb08fb3c 100644 --- a/client/src/com/vaadin/client/ui/VUpload.java +++ b/client/src/com/vaadin/client/ui/VUpload.java @@ -184,7 +184,7 @@ public class VUpload extends SimplePanel { /** For internal use only. May be removed or replaced in the future. */ public void disableUpload() { - submitButton.setEnabled(false); + setEnabledForSubmitButton(false); if (!submitted) { // Cannot disable the fileupload while submitting or the file won't // be submitted at all @@ -195,7 +195,7 @@ public class VUpload extends SimplePanel { /** For internal use only. May be removed or replaced in the future. */ public void enableUpload() { - submitButton.setEnabled(true); + setEnabledForSubmitButton(true); fu.getElement().setPropertyBoolean("disabled", false); enabled = true; if (submitted) { @@ -209,6 +209,12 @@ public class VUpload extends SimplePanel { } } + private void setEnabledForSubmitButton(boolean enabled) { + submitButton.setEnabled(enabled); + submitButton.setStyleName(ApplicationConnection.DISABLED_CLASSNAME, + !enabled); + } + /** * Re-creates file input field and populates panel. This is needed as we * want to clear existing values from our current file input field. -- cgit v1.2.3