[Databinding] Problem with listener of AggregateValidationStatus [message #334738] |
Wed, 25 February 2009 13:14  |
Eclipse User |
|
|
|
Hi,
I have a form with 6 fields that are bound using DataBindingContext. I
have a AggregateValidationStatus for the bindings with strategy as
MAX_SEVERITY. A listener has been attached to the
AggregateValidationStatus as below:-
IObservableValue status = new
AggregateValidationStatus(dataBindingContext.getBindings(),
AggregateValidationStatus.MAX_SEVERITY);
status.addValueChangeListener(new IValueChangeListener() {
public void handleValueChange(ValueChangeEvent event) {
// do something
}
});
When any of the text fields is modified, I need a callback to
handleValueChange method. Any thoughts?
I read through an earlier discussion. The solution suggested is to use
getValue() on the AggregateValidationStatus inside the listener. How do I
get a call to the listener everytime the text is modified?
http://dev.eclipse.org/newslists/news.eclipse.platform/msg80 116.html
Thanks,
Ravi
|
|
|
|
Re: [Databinding] Problem with listener of AggregateValidationStatus [message #334772 is a reply to message #334742] |
Thu, 26 February 2009 12:56  |
Eclipse User |
|
|
|
Thanks for the quick response, Matthew.
To capture the event, I am adding the listeners on the target observable.
Ravi
Matthew Hall wrote:
> Your AggregateValidationStatus will not necessarily change every time
> one of the text fields is updated, since intermediate values may have
> the same validation status (IStatus.OK) and in these situations no
> change event would be fired.
> You need to add listeners directly on your target IObservableValues
> rather than on an AggregateValidationStatus.
> Matthew
> Ravi wrote:
>> Hi,
>>
>> I have a form with 6 fields that are bound using DataBindingContext. I
>> have a AggregateValidationStatus for the bindings with strategy as
>> MAX_SEVERITY. A listener has been attached to the
>> AggregateValidationStatus as below:-
>> IObservableValue status = new
>> AggregateValidationStatus(dataBindingContext.getBindings(),
>> AggregateValidationStatus.MAX_SEVERITY);
>> status.addValueChangeListener(new IValueChangeListener() { public void
>> handleValueChange(ValueChangeEvent event) {
>> // do something
>> }
>> });
>>
>> When any of the text fields is modified, I need a callback to
>> handleValueChange method. Any thoughts?
>>
>> I read through an earlier discussion. The solution suggested is to use
>> getValue() on the AggregateValidationStatus inside the listener. How do
>> I get a call to the listener everytime the text is modified?
>> http://dev.eclipse.org/newslists/news.eclipse.platform/msg80 116.html
>>
>> Thanks,
>> Ravi
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03787 seconds