Table of Contents

Class FormBuilderTab

Namespace
Kentico.Xperience.Admin.DigitalMarketing.UIPages
Assembly
Kentico.Xperience.Admin.DigitalMarketing.dll

Page for the form builder.

public sealed class FormBuilderTab : Page<FormBuilderTabClientProperties>, IPage
Inheritance
object
FormBuilderTab
Implements
Inherited Members
Extension Methods

Constructors

FormBuilderTab(ISectionDefinitionProvider, IFormComponentDefinitionProvider, IFormItemCollectionProvider, IFormComponentCommandInvoker, IFormDataBinder, IHttpContextAccessor, IAuthenticatedUserAccessor, IContactMappingFieldsProvider, IUIPermissionEvaluator, IFormValidationRuleProvider, IFormValidationRuleActivator)

Initializes an instance of the FormBuilderTab class.

public FormBuilderTab(ISectionDefinitionProvider sectionDefinitionProvider, IFormComponentDefinitionProvider formComponentDefinitionProvider, IFormItemCollectionProvider formItemCollectionProvider, IFormComponentCommandInvoker formComponentCommandInvoker, IFormDataBinder formDataBinder, IHttpContextAccessor httpContextAccessor, IAuthenticatedUserAccessor authenticatedUserAccessor, IContactMappingFieldsProvider contactMappingOptionsProvider, IUIPermissionEvaluator permissionEvaluator, IFormValidationRuleProvider formValidationRuleProvider, IFormValidationRuleActivator formValidationRuleActivator)

Parameters

sectionDefinitionProvider ISectionDefinitionProvider
formComponentDefinitionProvider IFormComponentDefinitionProvider
formItemCollectionProvider IFormItemCollectionProvider
formComponentCommandInvoker IFormComponentCommandInvoker
formDataBinder IFormDataBinder
httpContextAccessor IHttpContextAccessor
authenticatedUserAccessor IAuthenticatedUserAccessor
contactMappingOptionsProvider IContactMappingFieldsProvider
permissionEvaluator IUIPermissionEvaluator
formValidationRuleProvider IFormValidationRuleProvider
formValidationRuleActivator IFormValidationRuleActivator

Properties

ObjectId

ID of the edited form.

[PageParameter(typeof(IntPageModelBinder))]
public int ObjectId { get; set; }

Property Value

int

Methods

ComponentCommand(FormComponentCommandModel, CancellationToken)

Handles the form component command invocation.

[PageCommand]
public Task<object> ComponentCommand(FormComponentCommandModel commandModel, CancellationToken cancellationToken)

Parameters

commandModel FormComponentCommandModel

Form component command arguments.

cancellationToken CancellationToken

The cancellation instruction.

Returns

Task<object>

Returns the form component command result.

ConfigureTemplateProperties(FormBuilderTabClientProperties)

Gets the object representing client side template properties.

public override Task<FormBuilderTabClientProperties> ConfigureTemplateProperties(FormBuilderTabClientProperties properties)

Parameters

properties FormBuilderTabClientProperties

Initialized properties object.

Returns

Task<FormBuilderTabClientProperties>

CreateValidationRule(CreateValidationRuleArgs)

Creates a validation rule for form field.

[PageCommand(Permission = "Update")]
public Task<ICommandResponse> CreateValidationRule(CreateValidationRuleArgs args)

Parameters

args CreateValidationRuleArgs

Returns

Task<ICommandResponse>

GetFormItems(ComponentPropertiesGetFormItemsCommandArgs)

Returns a collection of editing form items for given component specified by Identifier property of arguments to feed the Form.tsx with them.

[PageCommand(Permission = "View")]
public Task<ICommandResponse<IEnumerable<IFormItemClientProperties>>> GetFormItems(ComponentPropertiesGetFormItemsCommandArgs arguments)

Parameters

arguments ComponentPropertiesGetFormItemsCommandArgs

Returns

Task<ICommandResponse<IEnumerable<IFormItemClientProperties>>>

SaveMapping(ComponentSaveMappingCommandArg)

Saves mapping options.

[PageCommand(Permission = "Update")]
public Task SaveMapping(ComponentSaveMappingCommandArg arguments)

Parameters

arguments ComponentSaveMappingCommandArg

Returns

Task

ValidateComponents(ComponentPropertiesFormSubmissionCommandArgs)

Validates values of incoming collection of editing form components and returns a collection of updated form components and a flag if validation succeeded.

[PageCommand(Permission = "Update")]
public Task<ICommandResponse<ComponentPropertiesFormSubmissionCommandResult>> ValidateComponents(ComponentPropertiesFormSubmissionCommandArgs arguments)

Parameters

arguments ComponentPropertiesFormSubmissionCommandArgs

Returns

Task<ICommandResponse<ComponentPropertiesFormSubmissionCommandResult>>

ValidatePage()

Validates the page state prior invocation of the ConfigurePage() method.

public override Task<PageValidationResult> ValidatePage()

Returns

Task<PageValidationResult>

ValidateSaveFormBuilderPermissions()

Checks permissions for form builder save actions.

[PageCommand(Permission = "Update")]
public Task<bool> ValidateSaveFormBuilderPermissions()

Returns

Task<bool>

Remarks

Returns true if the user has permissions to perform save action in form builder. Otherwise this command will not execute and access denied message will be shown.