Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Problem with listener of AggregateValidationStatus
[Databinding] Problem with listener of AggregateValidationStatus [message #334738] Wed, 25 February 2009 18:14 Go to next message
Ravi is currently offline RaviFriend
Messages: 8
Registered: July 2009
Junior Member
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 19:28 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
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 17:56 Go to previous message
Ravi is currently offline RaviFriend
Messages: 8
Registered: July 2009
Junior Member
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: Sun Aug 11 18:31:29 GMT 2024

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

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

Back to the top