i have a dialog to show some values. Now I need to know if the user has changed something.
All fields are wrapped in an eclipse DatabindingContext.
...
bindingContext.bindValue(process_observable_milage, process_bean_mileage, new UpdateValueStrategy(), null);
...
If I change some fields, the propertyChangeSupport listener inside the model gets fired. (Setter of the property is called).
this.firePropertyChange(SignalEntity.SIGNALNAME, this.signalname, this.signalname = name);
Now I need a global Listener to detect if any value was changed.
I tried it with the following without success:
IObservableValue globalValidity = new WritableValue();
globalValidity.addChangeListener(new IChangeListener() {
@Override
public void handleChange(ChangeEvent event) {
dirty = true;
}
});
bindingContext.bindValue(globalValidity, new AggregateValidationStatus(bindingContext.getBindings(), AggregateValidationStatus.MAX_SEVERITY), null, null);
This is from another class with some afterConvertValidators added. So I thought I have to use "addValueChangeListener" instead but even this is not working.
IObservableValue globalValidity = new WritableValue();
globalValidity.addValueChangeListener(new IValueChangeListener() {
@Override
public void handleValueChange(ValueChangeEvent event) {
dirty = true;
}
});
bindingContext.bindValue(globalValidity, new AggregateValidationStatus(bindingContext.getBindings(), AggregateValidationStatus.MAX_SEVERITY), null, null);
Any ideas how to achieve this?
Best regards