Interface I_CmsFormField

All Known Implementing Classes:
CmsBasicFormField

public interface I_CmsFormField
The interface for a form field.

A form field consists of a widget for entering values, some metadata like a label text/description, and a set of validators for validating the field.

Since:
8.0.0
  • Method Details

    • bind

      void bind(I_CmsStringModel model)
      Binds a model object to the form field.

      Parameters:
      model - the model object
    • getDefaultValue

      Returns the default value for the form field.

      Returns:
      the default value for the form field
    • getDescription

      The description of the form field, or null if there is no description.

      Returns:
      a description string or null
    • getId

      Returns the id of this form field, or null if the form field id has not been set. If a form field without an id is added to a form, typically it will receive a synthetic id.
      Returns:
      the id
    • getLabel

      The label of the form field, or null if there is no label.

      Returns:
      a label or null
    • getLayoutData

      Returns the layout data for this field.

      Returns:
      the layout data for this field
    • getModel

      Returns the model object for this field.
      Returns:
      the model used for this field
    • getModelId

      Returns the model id.

      Returns:
      the model id
    • getModelValue

      Returns the model value.

      Returns:
      the model value
    • getValidationStatus

      Returns the validation status of this form field.

      If the field has no validator, this should always return valid.

      Returns:
      the validation status
    • getValidator

      Returns the validator for this form field, or null if the field has no validator.

      Returns:
      a validator or null
    • getWidget

      Returns the widget used by this form field.

      Returns:
      a widget
    • setId

      void setId(String id)
      Sets the id of this form field.

      Parameters:
      id - the new id
    • setValidationStatus

      Updates the validation status of this form field.

      This will only have an effect if the field has a validator.

      Parameters:
      status - the new validation status
    • setValidator

      void setValidator(I_CmsValidator validator)
      Sets the validator for this form field.

      Parameters:
      validator - the new validator
    • unbind

      void unbind()
      Removes the binding to this form field's model.