diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-06-14 08:59:12 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-06-14 08:59:12 +0000 |
commit | db8a72ead02f111ab2ff26bd64e8e35e976e41e3 (patch) | |
tree | e0671dbb6f736365e8809f205f9798b5cfd54ed4 /src | |
parent | 6566c5eb6f87e709ab6dc7099df084eec840558c (diff) | |
download | vaadin-framework-db8a72ead02f111ab2ff26bd64e8e35e976e41e3.tar.gz vaadin-framework-db8a72ead02f111ab2ff26bd64e8e35e976e41e3.zip |
improve compatibility with third party customization (e.g various switch/checkbox addons)
svn changeset:19364/svn branch:6.6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/ui/Button.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index a6df6df56b..122d155e0f 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -176,15 +176,29 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, if (newValue != null && !newValue.equals(oldValue) && !isReadOnly()) { setValue(newValue); - fireClick(MouseEventDetails.deSerialize((String) variables - .get("mousedetails"))); + if (variables.containsKey("mousedetails")) { + fireClick(MouseEventDetails + .deSerialize((String) variables + .get("mousedetails"))); + } else { + // for compatibility with custom implementations which + // don't send mouse details + fireClick(); + } } } else { // Only send click event if the button is pushed if (newValue.booleanValue()) { - fireClick(MouseEventDetails.deSerialize((String) variables - .get("mousedetails"))); + if (variables.containsKey("mousedetails")) { + fireClick(MouseEventDetails + .deSerialize((String) variables + .get("mousedetails"))); + } else { + // for compatibility with custom implementations which + // don't send mouse details + fireClick(); + } } // If the button is true for some reason, release it |