2
1
0
2 answers
- 210
Hi,
In v5, FormService had been changed to an interface with FormServiceImpl as its implementation.
I can't replicate your issue. From the error you posted, it could be you are building your plugin with v4 source code?
The following still the correct way to retrieve FormService.
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
Add your comment... - 10-1
I am able to resolve the issue by compiling the Code with V5 dependency
Add your comment...
FormDefinitionDao formDefinitionDao = (FormDefinitionDao) AppUtil.getApplicationContext().getBean("formDefinitionDao");
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
if
(formDef !=
null
) {
//create the form
Form form = (Form) formService.createElementFromJson(formDef.getJson(),
true
);