[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Re: how to use databinding to bind dynamic data
|
- From: d95776@xxxxxxxxx (hao)
- Date: Fri, 23 May 2008 10:19:26 +0000 (UTC)
- Newsgroups: eclipse.platform
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Let me explain what I am trying to ask:
For example, I have a model called Contact which has a name attribute. The
name field of the Contact is binded to a GUI text field called nameText.
When the GUI class is constructed, the following is called:
private Contact contact;
private Text nameText;
private DataBindingContext bindingContext;
...
//In constructor
IObservableValue contactNameObserveValue =
BeansObservables.observeValue(contact, "name");
IObservableValue nameTextTextObserveWidget =
SWTObservables.observeText(nameText, SWT.Modify);
bindingContext.bindValue(nameTextTextObserveWidget,
contactNameObserveValue, null, null);
For some reason, during the operation of the application, the contact
object is replaced with a new contact object. (Not the property name of
the contact object is changed but contact object itself is changed.) How
could I rebind the newly created contact object to nameText object?
thanks!