Search in sources :

Example 1 with INGFormElement

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;
}
Also used : IWebFormUI(com.servoy.j2db.server.ngclient.IWebFormUI) FormComponentCache(com.servoy.j2db.server.ngclient.FormElementHelper.FormComponentCache) Form(com.servoy.j2db.persistence.Form) JSForm(com.servoy.j2db.scripting.solutionmodel.JSForm) WebFormComponent(com.servoy.j2db.server.ngclient.WebFormComponent) ComponentTypeConfig(com.servoy.j2db.server.ngclient.property.ComponentTypeConfig) FormElement(com.servoy.j2db.server.ngclient.FormElement) INGFormElement(com.servoy.j2db.server.ngclient.INGFormElement) IFormElement(com.servoy.j2db.persistence.IFormElement)

Aggregations

Form (com.servoy.j2db.persistence.Form)1 IFormElement (com.servoy.j2db.persistence.IFormElement)1 JSForm (com.servoy.j2db.scripting.solutionmodel.JSForm)1 FormElement (com.servoy.j2db.server.ngclient.FormElement)1 FormComponentCache (com.servoy.j2db.server.ngclient.FormElementHelper.FormComponentCache)1 INGFormElement (com.servoy.j2db.server.ngclient.INGFormElement)1 IWebFormUI (com.servoy.j2db.server.ngclient.IWebFormUI)1 WebFormComponent (com.servoy.j2db.server.ngclient.WebFormComponent)1 ComponentTypeConfig (com.servoy.j2db.server.ngclient.property.ComponentTypeConfig)1