Version: 8.0.0.beta1
I want to reload a value of a field that is linked with a binder to a bean.
If i use
binder.readBean(bean)
then this method is invoked for each binding:
private void initFieldValue(BEAN bean) {
assert bean != null;
assert onValueChange != null;
onValueChange.remove();
try {
getField().setValue(convertDataToFieldType(bean));
} finally {
onValueChange = getField()
.addValueChangeListener(this::handleFieldValueChange);
}
}
Problem here is that the valueChangeListener that links the value of the field to the bean is first removed and then added again. Thus the order of the valueChangeListeners is changed.
I would like to see a method in the binding interface that just calls
getField().setValue(convertDataToFieldType(getBinder().getBean()));
FYI: I use a workaround that calls this methods by reflection