[EMF Forms] Databinding does not work for XMLResource based model element [message #1694222] |
Sat, 02 May 2015 11:32  |
Eclipse User |
|
|
|
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 #1694246 is a reply to message #1694237] |
Sun, 03 May 2015 13:47  |
Eclipse User |
|
|
|
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/
|
|
|
Powered by
FUDForum. Page generated in 1.11463 seconds