Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Problem with listener of AggregateValidationStatus
[Databinding] Problem with listener of AggregateValidationStatus [message #334738] Wed, 25 February 2009 13:14 Go to next message
Eclipse UserFriend
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 #334742 is a reply to message #334738] Wed, 25 February 2009 14:28 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: [Databinding] Problem with listener of AggregateValidationStatus [message #334772 is a reply to message #334742] Thu, 26 February 2009 12:56 Go to previous message
Eclipse UserFriend
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
>>
Previous Topic:[DataBinding] Best pratice to observe instance model (Bean, EMF..) which change
Next Topic:retrieving local history of an IFile
Goto Forum:
  


Current Time: Wed Mar 19 13:24:01 EDT 2025

Powered by FUDForum. Page generated in 0.03346 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top