use of com.servoy.j2db.server.ngclient.INGFormElement in project servoy-client by Servoy.
the class FormComponentPropertyType method toSabloComponentValue.
@Override
public Object toSabloComponentValue(Object formElementValue, PropertyDescription pd, INGFormElement formElement, WebFormComponent component, DataAdapterList dataAdapterList) {
Form form = getForm(formElementValue, dataAdapterList.getApplication().getFlattenedSolution());
if (form != null) {
if (pd.getConfig() instanceof ComponentTypeConfig && ((ComponentTypeConfig) pd.getConfig()).forFoundset != null) {
return new FormComponentSabloValue(formElement, (JSONObject) formElementValue, pd, dataAdapterList, component, form);
} else {
FormComponentCache formComponentCache = FormElementHelper.INSTANCE.getFormComponentCache(formElement, pd, (JSONObject) formElementValue, form, dataAdapterList.getApplication().getFlattenedSolution());
List<FormElement> elements = formComponentCache.getFormComponentElements();
IWebFormUI formUI = component.findParent(IWebFormUI.class);
for (FormElement element : elements) {
WebFormComponent child = ComponentFactory.createComponent(dataAdapterList.getApplication(), dataAdapterList, element, component.getParent(), dataAdapterList.getForm().getForm());
formUI.contributeComponentToElementsScope(element, element.getWebComponentSpec(), child);
}
}
}
return formElementValue;
}
Aggregations