aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2020-12-03 05:27:30 +0200
committerGitHub <noreply@github.com>2020-12-03 05:27:30 +0200
commit5c839bc6837b90d72561f3a478c0d6089a8f17ba (patch)
tree4b17b1a847d36805266f3520c7861e608b12ca37 /server/src/main/java/com/vaadin
parentd59c3d303be95d38320f94b5d7cde068824d81fd (diff)
downloadvaadin-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.java10
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);
}