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 Detail

      • bind

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

        Parameters:
        model - the model object
      • getDefaultValue

        java.lang.Object getDefaultValue()
        Returns the default value for the form field.

        Returns:
        the default value for the form field
      • getDescription

        java.lang.String getDescription()
        The description of the form field, or null if there is no description.

        Returns:
        a description string or null
      • getId

        java.lang.String 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

        java.lang.String getLabel()
        The label of the form field, or null if there is no label.

        Returns:
        a label or null
      • getModelId

        java.lang.String getModelId()
        Returns the model id.

        Returns:
        the model id
      • getModelValue

        java.lang.String getModelValue()
        Returns the model value.

        Returns:
        the model value
      • getValidator

        I_CmsValidator getValidator()
        Returns the validator for this form field, or null if the field has no validator.

        Returns:
        a validator or null
      • setId

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

        Parameters:
        id - the new id
      • 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.