Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » EMF Databinding Issue
EMF Databinding Issue [message #1352483] Tue, 13 May 2014 13:40 Go to next message
Xavipen Mising name is currently offline Xavipen Mising name
Messages: 49
Registered: March 2011
Member
Hi,

I am using EMF to model the data. Then on the views I have defined databindings so the views would be updated when the data is changed on the back ground.

As an example an snippet of one of the bindings:

                EMFDataBindingContext dataBindingContext = new EMFDataBindingContext();
		IObservableValue uiElement = WidgetProperties.text(SWT.Modify).observeDelayed(500, text);
		IObservableValue modelElement = EMFProperties.value(attribute).observe(eobject);
                EMFUpdateValueStrategy targetToModel = new EMFUpdateValueStrategy(EMFUpdateValueStrategy.POLICY_NEVER);
                EMFUpdateValueStrategy modelToTarget = new EMFUpdateValueStrategy(EMFUpdateValueStrategy.POLICY_UPDATE);
		dataBindingContext.bindValue(uiElement, modelElement, targetToModel, modelToTarget);


When the View is opened for first time, all fields are updated and showing the right value. However, when I start an Action that modifies the EMF model data, I can see the log messages confirming that the data has been changed in the model but the UI is not updated. If i press the UI then the values in the widgets are changed.

I have put log messages in the Modifiers listeners and they do not get called until i click somewhere on the application.

The polling from the client using org.eclipse.swt.Request.getInstance().send() is working. So, most likely is that I have missed something defining the bindings, but i do not know what can it be.

Cheers,
Javi
Re: EMF Databinding Issue [message #1352510 is a reply to message #1352483] Tue, 13 May 2014 13:51 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1821
Registered: July 2009
Senior Member
Hi Javi,
you have to enable ServerPush in order to update the UI from the server.
Use |ServerPushSession#start()| and |ServerPushSession#stop()| to
activate/deactivate it. See also [1].

[1]
http://eclipse.org/rap/developers-guide/devguide.php?topic=server-push.html&version=2.2
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: EMF Databinding Issue [message #1352561 is a reply to message #1352510] Tue, 13 May 2014 14:16 Go to previous messageGo to next message
Xavipen Mising name is currently offline Xavipen Mising name
Messages: 49
Registered: March 2011
Member
Hi Ivan,

Thanks for the advice. I would take note of it, as it would be useful when i switch to use ServerPush.

It turn out, the pooling was not yet working. My bad, as i did not properly check it. After fixing it with the new script, everything is working.

rwt.remote.Server.getInstance().send()

Thanks for your help,
Javi
Re: EMF Databinding Issue [message #1352598 is a reply to message #1352561] Tue, 13 May 2014 14:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1821
Registered: July 2009
Senior Member
Hi Javi,
I'll quote myself from the other post:
"Since RAP 2.2 the class is named Connection. In RAP 2.1 it was Server."
Are you sure that you are using RAP 2.2?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: EMF Databinding Issue [message #1352852 is a reply to message #1352598] Tue, 13 May 2014 17:07 Go to previous message
Xavipen Mising name is currently offline Xavipen Mising name
Messages: 49
Registered: March 2011
Member
Hi Ivan,

You are correct. I though i was using 2.2 when i was actually using 2.1.1

So for 2.1.1 i had to use: rwt.remote.Server.getInstance().send()

and if i had understood correctly, when i move to a version 2.2+ I would have to use:

rwt.remote.Connection.getInstance().send()

Thanks again!
Javi
Previous Topic:Tabris Tree with Template and IOS
Next Topic:Alternative Client Polling stop working when code migrated from 1.4 to 2.2
Goto Forum:
  


Current Time: Wed Oct 01 00:07:57 GMT 2014

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

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