Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » [XWT] Update textfield value if context changed
[XWT] Update textfield value if context changed [message #645243] Thu, 16 December 2010 03:45 Go to next message
Eclipse UserFriend
Hi guys,

if the underlying context of an UI Element changed, how get's the UI updated? I have following example:
Object context = XWT.findElementByName(e.widget, "Root");
Client clientModel =  (Client)XWT.getDataContext(context);
clientModel.setName("Mr. Smith");
		
Text clientNameText= (Text) XWT.findElementByName(e.widget, "clientName");
//Something like clientNameText.refresh() ?


If I click a button, the code above gets executed. Is there a way which allows the binding to get automated updated? Calling
clientNameText.setText(clientModel.getName());

wouldn't be nice as the name is already bound to the textfield.

Thanks for any help!
Wolfgang
Re: [XWT] Update textfield value if context changed [message #645474 is a reply to message #645243] Fri, 17 December 2010 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Anyone? Is the requested functionality not available?

Thanks for replying!
Re: [XWT] Update textfield value if context changed [message #645751 is a reply to message #645243] Mon, 20 December 2010 07:08 Go to previous message
Eclipse UserFriend
If your Java model has the support of Bean property change notification,
your code should work as it is. Otherwise, you need to do via Jface Data
Binding (see my comment below).

> clientModel.setName("Mr. Smith");
It should be replaced by:

IObservableValue observableValue = XWT.findObservableValue(context,
clientModel, "name");
observableValue.setValue("Mr. Smith");

Best regards
Yves YANG
Previous Topic:Running Dojo Demo
Next Topic:How to: XWT and Helios
Goto Forum:
  


Current Time: Fri Jul 18 21:59:33 EDT 2025

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

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

Back to the top