CustomField constructor looks like this:
public CustomField(T defaultValue) {
super(defaultValue);
this.getElement().addEventListener("change", (e) -> {
this.updateValue();
});
}
...
...
protected void updateValue() {
this.setModelValue(this.generateModelValue(), false);
}
This means that any change that occurs at the client side will fire updateValue()
but if there is a “Value Change Listener”, the event received by it will NOT show it as coming from the client (see the false
value passed to setModelValue
. Is this a bug?
I feel that the correct constructor should be:
public CustomField(T defaultValue) {
super(defaultValue);
this.getElement().addEventListener("change", (e) -> {
this.setModelValue(this.generateModelValue(), true);
});
}