diff options
Diffstat (limited to 'src/com/itmill/toolkit/ui/Button.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/Button.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/itmill/toolkit/ui/Button.java b/src/com/itmill/toolkit/ui/Button.java index 0812f261ff..2bd0aac48d 100644 --- a/src/com/itmill/toolkit/ui/Button.java +++ b/src/com/itmill/toolkit/ui/Button.java @@ -27,8 +27,8 @@ public class Button extends AbstractField { boolean switchMode = false; /** - * Creates a new push button. The value of the push button is allways false - * and they are immediate by default. + * Creates a new push button. The value of the push button is false and it + * is immediate by default. * */ public Button() { @@ -39,8 +39,7 @@ public class Button extends AbstractField { /** * Creates a new push button. * - * The value of the push button is allways false and they are immediate by - * default. + * The value of the push button is false and it is immediate by default. * * @param caption * the Button caption. @@ -336,4 +335,14 @@ public class Button extends AbstractField { fireEvent(new Button.ClickEvent(this)); } + @Override + protected void setInternalValue(Object newValue) { + // Make sure only booleans get through + if (!(newValue instanceof Boolean)) { + throw new IllegalArgumentException(getClass().getSimpleName() + + " only accepts Boolean values"); + } + super.setInternalValue(newValue); + } + } |