From db8a72ead02f111ab2ff26bd64e8e35e976e41e3 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 14 Jun 2011 08:59:12 +0000 Subject: improve compatibility with third party customization (e.g various switch/checkbox addons) svn changeset:19364/svn branch:6.6 --- src/com/vaadin/ui/Button.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3