Search in sources :

Example 1 with ISMForm

use of com.servoy.j2db.solutionmodel.ISMForm in project servoy-client by Servoy.

the class JSSolutionModel method newFormInternal.

/**
 * @param name
 * @param superForm
 * @param isResponsive
 * @return
 */
private JSForm newFormInternal(String name, ISMForm superForm, Boolean isResponsive) {
    if (superForm == null) {
        throw new IllegalArgumentException("superForm cannot be null");
    }
    if (isResponsive != null && (superForm.isResponsiveLayout() || superForm.getParts().length > 0)) {
        throw new IllegalArgumentException("Cannot set the layout type of the child form because the superform '" + superForm.getName() + "' is not a logical form.");
    }
    try {
        Form form = createNewForm(null, name, null, superForm.getShowInMenu(), ((JSForm) superForm).getSupportChild().getSize());
        if (isResponsive != null)
            form.setResponsiveLayout(isResponsive.booleanValue());
        form.clearProperty(StaticContentSpecLoader.PROPERTY_DATASOURCE.getPropertyName());
        application.getFormManager().addForm(form, false);
        form.setExtendsID(((JSForm) superForm).getSupportChild().getID());
        return instantiateForm(form, true);
    } catch (RepositoryException e) {
        throw new RuntimeException(e);
    }
}
Also used : Form(com.servoy.j2db.persistence.Form) ISMForm(com.servoy.j2db.solutionmodel.ISMForm) IBaseSMForm(com.servoy.base.solutionmodel.IBaseSMForm) RepositoryException(com.servoy.j2db.persistence.RepositoryException)

Aggregations

IBaseSMForm (com.servoy.base.solutionmodel.IBaseSMForm)1 Form (com.servoy.j2db.persistence.Form)1 RepositoryException (com.servoy.j2db.persistence.RepositoryException)1 ISMForm (com.servoy.j2db.solutionmodel.ISMForm)1