Table of Contents

Class FormBuilderModelManager

Namespace
Kentico.Forms.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll

Model binder used for binding values when submitting forms built via Form builder.

public class FormBuilderModelManager : IFormBuilderModelManager
Inheritance
object
FormBuilderModelManager
Implements
Extension Methods

Constructors

FormBuilderModelManager(IFormProvider, IFormComponentVisibilityEvaluator, IBindablePropertiesCache, IFormComponentValidator)

Initializes a new instance of the FormBuilderModelManager class.

public FormBuilderModelManager(IFormProvider formProvider, IFormComponentVisibilityEvaluator formComponentVisibilityEvaluator, IBindablePropertiesCache bindablePropertiesCache, IFormComponentValidator formComponentValidator)

Parameters

formProvider IFormProvider

Provides form components for BizFormInfo.

formComponentVisibilityEvaluator IFormComponentVisibilityEvaluator

Evaluator for form component visibility.

bindablePropertiesCache IBindablePropertiesCache

Cache used to retrieve list of bindable properties.

formComponentValidator IFormComponentValidator

Helper class used to perform model validation.

Exceptions

ArgumentNullException

Thrown when formProvider or formComponentVisibilityEvaluator is null.

Methods

BindModelAsync(IFormComponentBinder, FormBuilderBindingContext)

Binds form components according to data source used by formComponentBinder. Moreover components are validated and the model state is filled with any errors that occurred during validation.

public Task<List<FormComponent>> BindModelAsync(IFormComponentBinder formComponentBinder, FormBuilderBindingContext bindingContext)

Parameters

formComponentBinder IFormComponentBinder

Responsible for binding form components. Default binder that binds from form collection can be created by CreateFormComponentBinder(Controller) method.

bindingContext FormBuilderBindingContext

Context containing necessary data for binding.

Returns

Task<List<FormComponent>>

Exceptions

ArgumentNullException

Thrown when formComponentBinder or bindingContext is null.