diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-21 17:06:57 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-22 14:08:15 +0000 |
commit | 66b1aa488099e8e79c3fb2fb1f0236c29f15f848 (patch) | |
tree | 8f9ccaeaf25c62d935de3575ecbeb61a46ca05e2 /server | |
parent | 45fb000147cda84221c70c8f9da1a9d316d3c54f (diff) | |
download | vaadin-framework-66b1aa488099e8e79c3fb2fb1f0236c29f15f848.tar.gz vaadin-framework-66b1aa488099e8e79c3fb2fb1f0236c29f15f848.zip |
Account for that converter can modify value (#8191)
Change-Id: Iee81b46c985bbb37b98d23433e42d8d007c30d6a
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractField.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index 5c4a3468bb..b52d733632 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -451,6 +451,16 @@ public abstract class AbstractField<T> extends AbstractComponent implements if (isReadOnly()) { throw new Property.ReadOnlyException(); } + try { + T doubleConvertedFieldValue = convertFromDataSource(convertToModel(newFieldValue)); + if (!equals(newFieldValue, doubleConvertedFieldValue)) { + newFieldValue = doubleConvertedFieldValue; + repaintIsNotNeeded = false; + } + } catch (Throwable t) { + // Ignore exceptions in the conversion at this stage. Any + // conversion error will be handled later by validate(). + } // Repaint is needed even when the client thinks that it knows the // new state if validity of the component may change |