Hmm. Am I just slow or am I seeing a bug? Looking at the latest version 24.6.0. Seems to me that convertBackToPresentation
is ignored when calling setBean: The BindingImpl.setBean(bean)
(line 2358) method calls BindingImpl.initFieldValue(bean, writeBackChangedValues=true)
(line 2372).
The BindingImpl.initFieldValue
methods ignores convertBackToPresentation
. Why is line 1535 not if (writeBackChangedValues && convertBackToPresentation && setter != null && !readOnly)
?
Also, aesthetically a little odd that so many other properties are passed into BindingImpl via the Builder but convertBackToPresentation
is an exception, and has to get called after BindingBuilder.bind(getter, setter)
.
I wandered over to the very interesting RFC: Moving towards validators in fields - #25 by Leif. I am fully in the “Displaying data should never change data” camp and also surprised that convertBackToPresentation does not default to false.