Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] bi-directional references - new entries are created as root entries
[EMF Forms] bi-directional references - new entries are created as root entries [message #1750283] Mon, 19 December 2016 14:30 Go to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016
Member
Hi,

I have a problem with bi-directional references:

I have 2 classes:
Company
Contact

A Company can have multiple contacts.
A Contact has 0..1 company.

I have a specific file structure
- Quote
- Description
- Contacts
- Contact 1
- Contact 2
- Companies
- Company 1


Problem in EMF Forms: Location of new entries

When I edit the contact entry, on the company field, if I click on "Create and link a new Company", the new Company object is created as a new root object.

I absolutely don't want that, the company has to be created in
Quote > Description > Companies

The same when I edit a company, if I click to create a new Contact, it is created at the root level as well. I want to keep my structure.

another problem: I even cannot remove those unwanted Contact and Company root entries.

Jim









Re: [EMF Forms] bi-directional references - new entries are created as root entries [message #1750344 is a reply to message #1750283] Tue, 20 December 2016 08:33 Go to previous message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Jim,
you must provide your own ReferenceService as you can then change the default behavior where new elements are added to.
Take a look at the DefaultReferenceService and the DefaultReferenceServiceFactory.
In short the DefaultReferenceServiceFactory is an OSGi Service which tells EMFForms that there is a ReferenceService and how it behaves. It allows EMFForms to instantiate the ReferenceService when needed.
The DefaultReferenceService is an implementation of the ReferenceService which lets EMF decide where an Element is added to the containment hierarchy.

Cheers,
Eugen
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Ecore cross references not working (?)
Next Topic:[EMF Forms] Custom Databinding converters
Goto Forum:
  


Current Time: Sat Apr 20 01:22:30 GMT 2024

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

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

Back to the top