]> source.dussan.org Git - vaadin-framework.git/commitdiff
Continued fix for #1475: setReadOnly(true) fails for: Checkbox, Button, Upload
authorJani Laakso <jani.laakso@itmill.com>
Fri, 7 Mar 2008 13:25:29 +0000 (13:25 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Fri, 7 Mar 2008 13:25:29 +0000 (13:25 +0000)
Checkbox and Button setReadonly(false) now ignores variable changes.

svn changeset:3999/svn branch:trunk

src/com/itmill/toolkit/ui/Button.java

index 538c8953d6565a35bb692832cb83a3e8a395b369..0ece73eb7aa948fafdc2614dfd9c0dc9942efcdd 100644 (file)
@@ -152,7 +152,11 @@ public class Button extends AbstractField {
      * @param variables
      */
     public void changeVariables(Object source, Map variables) {
-        if (variables.containsKey("state")) {
+        if (isReadOnly()) {
+            System.err
+                    .println("Button: ignoring change variable for read-only component, caption="
+                            + getCaption());
+        } else if (variables.containsKey("state")) {
             // Gets the new and old button states
             final Boolean newValue = (Boolean) variables.get("state");
             final Boolean oldValue = (Boolean) getValue();