[EMFForms 1.7] Problem Creating an Editable Form [message #1735236] |
Thu, 16 June 2016 10:04  |
Eclipse User |
|
|
|
Hi,
I'm trying to create an EMFForm for the attached model, but serveral things seem to be missing:
1. my view model does not seem to be used by the running application (the plugin with the extension point is in the run config)
2. the displayed form does not include these little "add" and "delete" buttons shown in one of the emfform blog posts to add models at runtime, but there are some link and unlink incons which produce nullpointer exceptions when clicking on them
background:
the approval levels should be pre filled (lets say 3 level) - model instances should be produced via java code.
the emfform should allow to configure each of them with their attributes and assign the corresponding roles.
the available roles are also pre filled by java code.
i thought of a table or a master/detail view for the UI.
I think i've done something seriously wrong. (maybe at design time of the model?)
i'm starting that with:
model = EcoreUtil.create(ApprovalPackage.eINSTANCE.getAvailableApprovalLevels())
render = ECPSWTViewRenderer.INSTANCE.render(parent, model);
thanks for any hints on what could be wrong.
PS: i renamed the model files before upload....
|
|
|
|
|
|
|
Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739439 is a reply to message #1739413] |
Mon, 01 August 2016 08:46   |
Eclipse User |
|
|
|
I upgraded to emfforms 1.9
to avoid "the sub package" problem, i moved the corresponding eclass definition to an own .ecore file (see attached .model, .genmodel and view model).
The view model is (for now) just the default generated one - the preview shows something. If i could get the same in my application that would be a start 
additionally i added the following bundles to my launch config:
org.eclipse.emfforms.swt.table
org.eclipse.emf.ecp.view.table.ui.swt
org.eclipse.emfforms.core.services.structuralchange
org.eclipse.emfforms.core.services.structuralchange.default
org.eclipse.emfforms.core.services.structuralchange.table
org.eclipse.emfforms.core.services.domainexpander.default
org.eclipse.emfforms.core.services.domainexpander.table
org.eclipse.emfforms.core.services.mappingprovider.default
org.eclipse.emfforms.core.services.mappingprovider.table
When trying to render the form the following log messages appear in the console:
!ENTRY org.eclipse.emf.ecp.view.model 4 0 2016-08-01 14:19:05.099
!MESSAGE No view service of type 'org.eclipse.emfforms.spi.swt.core.di.EMFFormsContextProvider' found.
14:19:05.099 ERROR [model] No view service of type 'org.eclipse.emfforms.spi.swt.core.di.EMFFormsContextProvider' found.
!ENTRY org.eclipse.emf.ecp.view.model 4 0 2016-08-01 14:19:05.100
!MESSAGE The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.
14:19:05.100 ERROR [model] The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.
I debugged the form creation process, the error messages comes from:
EMFFormsDIRendererFactory
final AbstractSWTRenderer<VElement> rendererInstance = bestService.getRendererInstance(vElement,
viewModelContext);
-> resolve to
EMFFormsDIRendererFactory.getRendererInstance
which exit's at
final EMFFormsContextProvider contextProvider = viewModelContext.getService(EMFFormsContextProvider.class);
if (contextProvider == null) {
reportService
.report(new AbstractReport(
"The given ViewModelContext does not have a EMFFormsContextProvider. Hence, no renderer instance can be created.")); //$NON-NLS-1$
return null;
}
I wasn't able to understand, why there is no contextProvider available.
Any suggestions and hints are more than welcome!
thx, bye Peter
|
|
|
|
|
Re: [EMFForms 1.9] Problem Creating an Editable Form [message #1739499 is a reply to message #1739497] |
Tue, 02 August 2016 09:01  |
Eclipse User |
|
|
|
Hi Peter,
the index dmr and mapping dmr are not in the ecp.sdk feature as we see them as more advanced features which are not needed for the base case. (we should remove them from the setup.base bundle also).
The same goes for the multiattribute feature.
Glad that it works.
Cheers,
Eugen
|
|
|
Powered by
FUDForum. Page generated in 0.04971 seconds