[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] [DataBinding] Re: Binding the attribute of a bean object wrapped in a WritableValue object

Hao wrote:
IObservableValue bindedNameTextObserveWidget = SWTObservables.observeText(text);
IObservableValue selectedContactNameObserveDetailValue = BeansObservables.observeDetailValue(Realm.getDefault(), contactObservable, "name", java.lang.String.class);


bindingContext.bindValue(bindedNameTextObserveWidget, contactObservable, null, null);

It looks like you're binding to the wrong observable. You have:

bindingContext.bindValue(bindingNameTextObserveWidget,
                         contactObservable, // <-- wrong observable
                         null,
                         null);

But I think it should be:

bindingContext.bindValue(bindingNameTextObserveWidget,
                         selectedContactNameObserveDetailValue,
                         null,
                         null);

Matthew