Search in sources :

Example 1 with FormValidatorImpl

use of org.kie.workbench.common.forms.processing.engine.handling.impl.FormValidatorImpl in project kie-wb-common by kiegroup.

the class DynamicFormHandlerGenerator method generateFormHandler.

@Override
public FormHandler generateFormHandler(MapModelRenderingContext context) {
    DynamicModelValidator dynamicValidator = new DynamicModelValidator(validator);
    if (context.getRootForm().getModel() instanceof JavaFormModel) {
        DynamicModelConstraints constraints = context.getModelConstraints().get(((JavaFormModel) context.getRootForm().getModel()).getType());
        if (constraints != null) {
            dynamicValidator.setModelConstraints(constraints);
        }
    }
    FormValidator formValidator = new FormValidatorImpl(dynamicValidator, fieldStateValidator);
    FormHandler handler = new FormHandlerImpl(formValidator, new FieldChangeHandlerManagerImpl());
    if (context.getParentContext() == null) {
        helper.initContext(context);
    }
    return handler;
}
Also used : DynamicModelValidator(org.kie.workbench.common.forms.dynamic.client.processing.engine.handling.DynamicModelValidator) DynamicModelConstraints(org.kie.workbench.common.forms.dynamic.service.shared.impl.validation.DynamicModelConstraints) FieldChangeHandlerManagerImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FieldChangeHandlerManagerImpl) FormValidatorImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FormValidatorImpl) FormHandler(org.kie.workbench.common.forms.processing.engine.handling.FormHandler) FormHandlerImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FormHandlerImpl) JavaFormModel(org.kie.workbench.common.forms.model.JavaFormModel) FormValidator(org.kie.workbench.common.forms.processing.engine.handling.FormValidator)

Example 2 with FormValidatorImpl

use of org.kie.workbench.common.forms.processing.engine.handling.impl.FormValidatorImpl in project kie-wb-common by kiegroup.

the class StaticFormHandlerGenerator method generateFormHandler.

@Override
public FormHandler generateFormHandler(FormRenderingContext context) {
    FormValidator formValidator = new FormValidatorImpl(new DefaultModelValidator(validator), fieldStateValidator);
    FormHandler handler = new FormHandlerImpl(formValidator, new FieldChangeHandlerManagerImpl());
    return handler;
}
Also used : DefaultModelValidator(org.kie.workbench.common.forms.processing.engine.handling.impl.DefaultModelValidator) FieldChangeHandlerManagerImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FieldChangeHandlerManagerImpl) FormValidatorImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FormValidatorImpl) FormHandler(org.kie.workbench.common.forms.processing.engine.handling.FormHandler) FormHandlerImpl(org.kie.workbench.common.forms.processing.engine.handling.impl.FormHandlerImpl) FormValidator(org.kie.workbench.common.forms.processing.engine.handling.FormValidator)

Aggregations

FormHandler (org.kie.workbench.common.forms.processing.engine.handling.FormHandler)2 FormValidator (org.kie.workbench.common.forms.processing.engine.handling.FormValidator)2 FieldChangeHandlerManagerImpl (org.kie.workbench.common.forms.processing.engine.handling.impl.FieldChangeHandlerManagerImpl)2 FormHandlerImpl (org.kie.workbench.common.forms.processing.engine.handling.impl.FormHandlerImpl)2 FormValidatorImpl (org.kie.workbench.common.forms.processing.engine.handling.impl.FormValidatorImpl)2 DynamicModelValidator (org.kie.workbench.common.forms.dynamic.client.processing.engine.handling.DynamicModelValidator)1 DynamicModelConstraints (org.kie.workbench.common.forms.dynamic.service.shared.impl.validation.DynamicModelConstraints)1 JavaFormModel (org.kie.workbench.common.forms.model.JavaFormModel)1 DefaultModelValidator (org.kie.workbench.common.forms.processing.engine.handling.impl.DefaultModelValidator)1