Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsBinding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713131/#msg_1713131
Here is my custom control Editor class:
public class PrivilegesEditor extends ECPAbstractCustomControlSWT {
]]>2015-11-01T05:11:03-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713219/#msg_1713219
I don't get whats going on. You write:
"I open the first object in my ECP form. While it is still active, I open a second object in a second instance of the same ECP form. "
So you have called:
ECPSWTViewRenderer.INSTANCE.render() once or twice?
Did you reuse your View Model for both render steps?
Cheers,
Eugen
]]>Eugen Neufeld2015-11-02T13:27:09-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713245/#msg_1713245
ECPSWTViewRenderer.INSTANCE.render(parent, theObject, viewModel);
Yes, using the same viewModel but different domain objects.
-francine]]>2015-11-02T18:11:12-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713279/#msg_1713279
2015-11-03T00:43:55-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713372/#msg_1713372
The problem is the reuse of the view model. EMFForms stores some information during rendering in the view model. This is especially the case for the resolved EObjects (so the concrete EObject reachable by the DomainModelReference).
You need to use a second ViewModel for the second render step.
Is there a reason you reused the ViewModel?
Cheers,
Eugen]]>Eugen Neufeld2015-11-03T16:03:08-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713388/#msg_1713388
At start up, we create a Hashmap of the various view models. We have one for "create" and one for "display" for each of our forms. Then when we want to render a form, we get the model for the associated object, either the "create" or the "display" version. We are trying to show two different objects in two separate instances of the same form that use the same "display" view model? How is this done?]]>2015-11-03T18:16:32-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713445/#msg_1713445
you can always return a copy of the view model you need using EcoreUtil.copy(myViewModel) .
Take a look at XMIViewModelProvider .
Why don't you use the XMIViewModelProvider directly?
Cheers,
Eugen]]>Eugen Neufeld2015-11-04T09:03:54-00:00Re: Binding Ecore model object to ECP form custom control
https://www.eclipse.org/forums/index.php/mv/msg/1071704/1713549/#msg_1713549
Thanks! That seems to work.