]> source.dussan.org Git - vaadin-framework.git/commitdiff
improve compatibility with third party customization (e.g various switch/checkbox...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 14 Jun 2011 08:59:12 +0000 (08:59 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 14 Jun 2011 08:59:12 +0000 (08:59 +0000)
svn changeset:19364/svn branch:6.6

src/com/vaadin/ui/Button.java

index a6df6df56bf2c3ad049d089796abada250ecd7f4..122d155e0f091dc249d6836d1f24679d4aa07adc 100644 (file)
@@ -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