Class FormComponentProperties
Defines properties which are common to all form components. Do not inherit this class directly, inherit the FormComponentProperties<TValue> class instead.
public abstract class FormComponentProperties
- Inheritance
-
objectFormComponentProperties
- Derived
-
FormComponentProperties<TValue>
- Extension Methods
Constructors
FormComponentProperties(string, int, int)
Initializes a new instance of the FormComponentProperties class using the data type, size and precision given.
protected FormComponentProperties(string dataType, int size, int precision)
Parameters
dataTypestringDefault data type of values (typically a constant from FieldDataType).
sizeintDefault size of values.
precisionintDefault precision of values.
- See Also
Properties
DataType
Gets or sets the underlying field data type.
public string DataType { get; set; }
Property Value
- string
- See Also
ExplanationText
Gets or sets the explanation text of the form component.
[TextInputComponent(Label = "{$kentico.formbuilder.explanation$}", Order = -70)]
[EditingComponent("Kentico.TextInput", Label = "{$kentico.formbuilder.explanation$}", Order = -70)]
public virtual string ExplanationText { get; set; }
Property Value
- string
Guid
Gets or sets the underlying field GUID.
public Guid Guid { get; set; }
Property Value
- Guid
Label
Gets or sets the label of the form component.
[TextInputComponent(Label = "{$general.label$}", Order = -120)]
[EditingComponent("Kentico.TextInput", Label = "{$general.label$}", Order = -120)]
public virtual string Label { get; set; }
Property Value
- string
Name
Gets or sets the underlying field name.
[TextInputComponent(Label = "{$kentico.formbuilder.fieldname.label$}", Tooltip = "{$kentico.formbuilder.fieldname.tooltip$}", Order = -90)]
[RequiredValidationRule]
[IdentifierValidationRule]
[MaxLengthValidationRule(100)]
[EditingComponent("Kentico.Name", Label = "{$kentico.formbuilder.fieldname.label$}", Tooltip = "{$kentico.formbuilder.fieldname.tooltip$}", Order = -90)]
[Required]
public virtual string Name { get; set; }
Property Value
- string
Placeholder
Gets or sets the value displayed as placeholder in the input. Override and annotate with EditingComponentAttribute to make this property editable in properties panel.
public virtual string Placeholder { get; set; }
Property Value
- string
Precision
Gets or sets the underlying field precision.
public int Precision { get; set; }
Property Value
- int
- See Also
Required
Gets or sets value indicating whether the underlying field is required. False by default. If false, the form component's implementation must accept nullable input.
[CheckBoxComponent(Label = "{$kentico.formbuilder.required.label$}", Order = -110)]
[EditingComponent("Kentico.CheckBox", Label = "", Order = -110)]
[EditingComponentProperty("Text", "{$kentico.formbuilder.required.label$}")]
public virtual bool Required { get; set; }
Property Value
- bool
Size
Gets or sets the underlying field size.
public int Size { get; set; }
Property Value
- int
- See Also
SmartField
Gets or sets value indicating whether the underlying field is smart field. False by default.
[CheckBoxComponent(Label = "{$kentico.formbuilder.smartfield.label$}", Tooltip = "{$kentico.formbuilder.smartfield.tooltip$}", Order = -100)]
[EditingComponent("Kentico.CheckBox", Label = "", Tooltip = "{$kentico.formbuilder.smartfield.tooltip$}", Order = -100)]
[EditingComponentProperty("Text", "{$kentico.formbuilder.smartfield.label$}")]
public virtual bool SmartField { get; set; }
Property Value
- bool
Tooltip
Gets or sets the tooltip of the form component.
[TextInputComponent(Label = "{$kentico.formbuilder.tooltip$}", Order = -60)]
[EditingComponent("Kentico.TextInput", Label = "{$kentico.formbuilder.tooltip$}", Order = -60)]
public virtual string Tooltip { get; set; }
Property Value
- string
ValidationRuleConfigurations
Gets or sets validation rule configurations assigned to the form component.
public IList<ValidationRuleConfiguration> ValidationRuleConfigurations { get; set; }
Property Value
- IList<ValidationRuleConfiguration>
VisibilityConditionConfiguration
Gets or sets visibility condition configuration assigned to the form component.
public VisibilityConditionConfiguration VisibilityConditionConfiguration { get; set; }
Property Value
Methods
GetDefaultValue()
When overridden in a derived class, gets the default value.
public abstract object GetDefaultValue()
Returns
- object
Returns the default value.
SetDefaultValue(object)
When overridden in a derived class, sets the default value to value.
The value must be of proper type or an exception is thrown.
public abstract void SetDefaultValue(object value)
Parameters
valueobjectValue to be set as the default value.