use of com.servoy.j2db.scripting.solutionmodel.JSForm in project servoy-client by Servoy.
the class FormComponentPropertyType method getForm.
public Form getForm(Object formElementValue, FlattenedSolution fs) {
Object formId = formElementValue;
if (formId instanceof JSONObject) {
formId = ((JSONObject) formId).optString("svy_form");
}
Form form = null;
if (formId instanceof Integer) {
form = fs.getForm(((Integer) formId).intValue());
} else if (formId instanceof String || formId instanceof UUID) {
// try first by name or uuid (FS caches by both)
form = fs.getForm(formId.toString());
if (form == null) {
form = (Form) fs.searchPersist(formId.toString());
}
} else if (formId instanceof JSForm) {
return ((JSForm) formId).getSupportChild();
}
return form;
}
use of com.servoy.j2db.scripting.solutionmodel.JSForm 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);
}
}
Aggregations