Skip to main content



      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 11:32 Go to next message
Eclipse UserFriend
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 07:59 Go to previous messageGo to next message
Eclipse UserFriend
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 13:47 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 04:17:56 EDT 2025

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

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

Back to the top