use of com.servoy.j2db.BasicFormController in project servoy-client by Servoy.
the class RuntimeWindow method showObject.
public void showObject(Object form) throws ServoyException {
String f = null;
if (form instanceof BasicFormController) {
f = ((BasicFormController) form).getName();
} else if (form instanceof FormScope) {
f = ((FormScope) form).getFormController().getName();
} else if (form instanceof FormController.JSForm) {
f = ((FormController.JSForm) form).getFormPanel().getName();
} else if (form instanceof String) {
f = (String) form;
} else if (form instanceof JSForm) {
f = ((JSForm) form).getName();
}
if (f != null) {
Form frm = application.getFlattenedSolution().getForm(f);
IBasicFormManager fm = application.getFormManager();
if (frm == null && fm.isPossibleForm(f))
frm = fm.getPossibleForm(f);
if (!application.getFlattenedSolution().formCanBeInstantiated(frm)) {
// abstract form
throw new ApplicationException(ServoyException.ABSTRACT_FORM, new Object[] { f });
}
show(f);
}
}
use of com.servoy.j2db.BasicFormController in project servoy-client by Servoy.
the class DataAdapterList method updateParentContainer.
private void updateParentContainer(IWebFormController relatedController, String relationName, boolean visible) {
if (((BasicFormController) relatedController).isDestroyed())
return;
if (visible) {
WebFormComponent parentContainer = null;
Collection<WebComponent> components = formController.getFormUI().getComponents();
for (WebComponent component : components) {
// legacy behavior
Object tabs = component.getProperty("tabs");
if (tabs instanceof List && ((List) tabs).size() > 0) {
List tabsList = (List) tabs;
for (Object element : tabsList) {
Map<String, Object> tab = (Map<String, Object>) element;
if (tab != null) {
String relation = tab.get("relationName") != null ? tab.get("relationName").toString() : null;
Object form = tab.get("containsFormId");
if (Utils.equalObjects(form, relatedController.getName()) && Utils.equalObjects(relation, relationName)) {
parentContainer = (WebFormComponent) component;
break;
}
}
}
}
}
// // for non legacy components, wait for client to set correct parent; do not set null
if (parentContainer != null || !relatedController.getForm().isResponsiveLayout()) {
relatedController.getFormUI().setParentContainer(parentContainer);
}
}
}
Aggregations