Class RegisterFormComponentAttribute
Registers a form component to Form builder.
public sealed class RegisterFormComponentAttribute : RegisterComponentAttribute, IPreInitAttribute
- Inheritance
-
objectAttributeRegisterFormComponentAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
RegisterFormComponentAttribute(string, Type, string)
Initializes a new instance of the RegisterFormComponentAttribute class.
public RegisterFormComponentAttribute(string identifier, Type formComponentType, string name)
Parameters
identifierstringUnique identifier of the form component.
formComponentTypeTypeType of the form component. The form component must inherit the FormComponent<TProperties, TValue> class.
namestringName of the form component.
Remarks
Make sure to provide a unique identifier for the form component from the start. This identifier is used within the form configuration of components and any further change can lead to incorrect configuration load. Consider specifying identifier in format 'CompanyName.ModuleName.ComponentName', e.g. 'Kentico.Content.TextInputComponent'.
Properties
Description
Description of the registered component.
public string Description { get; set; }
Property Value
- string
IconClass
Font-icon CSS class of the registered component.
public string IconClass { get; set; }
Property Value
- string
IsAvailableInFormBuilderEditor
Determines if the form component can be added via Form builder UI to a form. Set to false to allow the component to be used programmatically only. True by default.
public bool IsAvailableInFormBuilderEditor { get; set; }
Property Value
- bool
IsMappableToContactFields
Determines if the form component can mapped to contact fields. Set to false to hide the 'Mapped to contact attribute' field in component properties dialog. True by default if the form component is available in Form builder (IsAvailableInFormBuilderEditor).
public bool IsMappableToContactFields { get; set; }
Property Value
- bool
ViewName
Name of the view to render.
public string ViewName { get; set; }
Property Value
- string
Remarks
If not set default location is used ("FormComponents/_{Identifier}").
Methods
PreInit()
Registers the form component during application pre-initialization.
public override void PreInit()