summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2012-11-05 14:00:21 +0200
committerVaadin Code Review <review@vaadin.com>2012-11-05 14:32:28 +0000
commit1746dff124c644f4348ccf3ecf55d250a8869d75 (patch)
tree8b1a34d61bc3e137019fefefafe706152c63f9ef /client
parent282fbd32a1deb70565be0ed4718c3ee29d26651d (diff)
downloadvaadin-framework-1746dff124c644f4348ccf3ecf55d250a8869d75.tar.gz
vaadin-framework-1746dff124c644f4348ccf3ecf55d250a8869d75.zip
10030 Button.DisableOnClick not working properly
Change-Id: I0514bc4da186360a84d9cdb48140245108847115
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/button/ButtonConnector.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/button/ButtonConnector.java b/client/src/com/vaadin/client/ui/button/ButtonConnector.java
index 546bdecb61..c3aa66b285 100644
--- a/client/src/com/vaadin/client/ui/button/ButtonConnector.java
+++ b/client/src/com/vaadin/client/ui/button/ButtonConnector.java
@@ -156,7 +156,13 @@ public class ButtonConnector extends AbstractComponentConnector implements
@Override
public void onClick(ClickEvent event) {
if (getState().disableOnClick) {
- getWidget().setEnabled(false);
+ // Simulate getting disabled from the server without waiting for the
+ // round trip. The server-side RPC handler takes care of updating
+ // the server-side state in a similar way to ensure subsequent
+ // changes are properly propagated. Changing state on client is not
+ // generally supported.
+ getState().enabled = false;
+ super.updateEnabledState(false);
rpc.disableOnClick();
}