Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Databinding does not work for XMLResource based model element
[EMF Forms] Databinding does not work for XMLResource based model element [message #1694222] Sat, 02 May 2015 15:32 Go to next message
Michael Gfeller is currently offline Michael GfellerFriend
Messages: 8
Registered: May 2015
Junior Member
Hi,

The model I'm working with is based on XSD. Models are stored in corresponding XML files.

If I load a model from a file, and use EMF Forms to display the element, the data is displayed, but changes are not written back to the EObject.

If I create the same model element using EcoreUtil.create(ThePackage.eINSTANCE.getTheElement()) then everything works as expected.

I was trying to find out by debugging and reading documentation, but was unfortunately not successfull.

One difference between the two model elements is that the one loaded from the XML file has an eContainer (the DocumentRoot) and eFlags, the other one not. Could this be relevant?

Thanks for your help!

Michael
Re: [EMF Forms] Databinding does not work for XMLResource based model element [message #1694237 is a reply to message #1694222] Sun, 03 May 2015 11:59 Go to previous messageGo to next message
Michael Gfeller is currently offline Michael GfellerFriend
Messages: 8
Registered: May 2015
Junior Member
Further investigation showed that the model element didn't have an editing domain.

The editing domain is added in org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl.addResourceIfNecessary() for model elements that do not have
an associated eResource. Since the model element loaded from a file has an eResource, no editing domain is added in ViewModelContextImpl.addResourceIfNecessary().

Adding the editing domain to the resource set of the model element solved the problem.

Michael
Re: [EMF Forms] Databinding does not work for XMLResource based model element [message #1694246 is a reply to message #1694237] Sun, 03 May 2015 17:47 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Great to hear, you already found the solution!

Am 03.05.2015 um 13:59 schrieb Michael Gfeller:
> Further investigation showed that the model element didn't have an
> editing domain.
>
> The editing domain is added in
> org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl.addResourceIfNecessary()
> for model elements that do not have an associated eResource. Since the
> model element loaded from a file has an eResource, no editing domain is
> added in ViewModelContextImpl.addResourceIfNecessary().
>
> Adding the editing domain to the resource set of the model element
> solved the problem.
>
> Michael


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[Texo] Restricting queries to users
Next Topic:[TEXO] Generate code with Maven
Goto Forum:
  


Current Time: Mon Aug 03 15:57:59 GMT 2020

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

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

Back to the top