diff options
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractField.java')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractField.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index 47ac953319..369ad1253c 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1402,7 +1402,8 @@ public abstract class AbstractField<T> extends AbstractComponent implements valueLocale); T newinternalValue = convertFromModel(convertedValue); if (!SharedUtil.equals(getInternalValue(), newinternalValue)) { - setConvertedValue(convertedValue); + setInternalValue(newinternalValue); + fireValueChange(false); } } } @@ -1512,6 +1513,19 @@ public abstract class AbstractField<T> extends AbstractComponent implements } /** + * Clear the value of the field. + * <p> + * The field value is typically reset to the initial value of the field but + * this is not mandatory. Calling {@link #isEmpty()} on a cleared field must + * always returns true. + * + * @since + */ + public void clear() { + setValue(null); + } + + /** * Is automatic, visible validation enabled? * * If automatic validation is enabled, any validators connected to this |