Hey, I’m using this binder in a form for a combobox:
// Headend
ComboBox<Headend> headend = new ComboBox<>(getTranslation("authority.headend"));
headend.setItemLabelGenerator(Headend::getName);
headend.setItems(headendService.dataProvider());
this.binder.forField(headend)
.asRequired(getTranslation("form.error.required"))
.withValidator(value -> authorityService.isHeadendAndCodeUnique(value, code.getValue(), id.getValue()), getTranslation("authority.headend.unique"))
.bind(Authority::getHeadend, Authority::setHeadend);
add(headend, 3);
Now in anothers binder value change listener, I wanna check the value of the headend binder. Sadly this always returns null:
pricing.addValueChangeListener(event -> {
System.out.println(headend.getValue());
});
What am I doing wrong? The selection in the frontend works and it shows the correct data even after saved an reloaded
The value change listener is only called with the object on save but not on editing itself.