diff options
author | Tatu Lund <tatu@vaadin.com> | 2020-12-03 05:27:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 05:27:30 +0200 |
commit | 5c839bc6837b90d72561f3a478c0d6089a8f17ba (patch) | |
tree | 4b17b1a847d36805266f3520c7861e608b12ca37 /server/src/main/java/com/vaadin | |
parent | d59c3d303be95d38320f94b5d7cde068824d81fd (diff) | |
download | vaadin-framework-5c839bc6837b90d72561f3a478c0d6089a8f17ba.tar.gz vaadin-framework-5c839bc6837b90d72561f3a478c0d6089a8f17ba.zip |
Binder: Also use converter for user-changed values (#12132)
See: https://vaadin.com/forum/thread/15931682
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r-- | server/src/main/java/com/vaadin/data/Binder.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java index d0ea628986..481b6df361 100644 --- a/server/src/main/java/com/vaadin/data/Binder.java +++ b/server/src/main/java/com/vaadin/data/Binder.java @@ -1282,7 +1282,15 @@ public class Binder<BEAN> implements Serializable { Result<TARGET> result = doConversion(); if (!isReadOnly()) { - result.ifOk(value -> setter.accept(bean, value)); + result.ifOk(value -> { + setter.accept(bean, value); + if (value != null) { + FIELDVALUE converted = convertToFieldType(value); + if (!field.getValue().equals(converted)) { + getField().setValue(converted); + } + } + }); } return toValidationStatus(result); } |