[DataBinding] - SimplePropertyObservableValue.doGetValue() fires off value change event to its liste [message #548763] |
Thu, 22 July 2010 21:45 |
Vasanth Velusamy Messages: 31 Registered: July 2009 |
Member |
|
|
org.eclipse.core.internal.databinding.property.value.SimpleP ropertyObservableValue.doGetValue()
has a call to notifyIfChanged() which, at times, fires off value change
events to its listeners. This has undesired results when all I am
looking at is getting the current value.
Should such actions be even done in a 'getter' method?
Here is the sceario I faced the problem:
I am querying the IObservableValue for its value in an IChangeListener
used in
org.eclipse.core.databinding.observable.IObservable.addChang eListener(IChangeListener),
and I get the undesired behavior that some other databound model is
modified when I am just querying for a value.
And a possible solution, if the issue is a valid one:
I didn't look at the code too deep, but should the call to
notifyIfChanged() in SimplePropertyObservableValue.doGetValue() be
replaced by this? (If all that is needed is to keep the cached value
up-to-date)
cachedValue = property.getValue(source);
Thanks,
Vasanth
|
|
|
Powered by
FUDForum. Page generated in 0.03825 seconds