Skip to main content

Form Fields

Introduction

  • Form Field is a configurable unit used to define fields displayed in forms for specific wizard steps, particularly those of the FORM type.
  • A Form Field should be mapped to either a Publication Metadata or one of the publication's properties (e.g., label, description).
  • It's possible to specify the type of the Form Field. By default, the field will use the type of the corresponding property/metadata. Supported types include:
    • Single-line Text (text)
    • Date (date)
    • Combobox (select): For this type, you can define a list of options called Selection or use a Plugin Method to fetch the options.
    • Bucket (bucket)
  • Additionally, a Form Field can be configured with the following options:
    • Required: The field is mandatory for the form, meaning the user must fill it out before submitting or saving.
    • Disabled: The field is displayed on the form but cannot be edited.

Configuration

ISON Configuration Details

Sample

<formFields>
<formField id="property_form_field">
<propertyAttribute>identifier</propertyAttribute>
<label>property_form_field_label</label>
<required>true</required>
<disabled>true</disabled>
<dependencies>
<dependency>
<formFieldId>text_form_field</formFieldId>
</dependency>
</dependencies>
<validations>
<validation id="minLength" label="min_length">3</validation>
</validations>
</formField>
<formField id="text_form_field">
<metadata>text_metadata</metadata>
<label>text_form_field_label</label>
</formField>
<formField id="date_form_field">
<metadata>date_metadata</metadata>
<label>date_form_field_label</label>
<type>date</type>
</formField>
<formField id="select_form_field">
<metadata>text_metadata</metadata>
<label>select_form_field_label</label>
<type>select</type>
<selection>select_form_selection</selection>
</formField>
<formField id="select_method_form_field">
<metadata>method_text_metadata</metadata>
<label>select_method_form_label</label>
<type>select</type>
<multiValue>true</multiValue>
<selectionMethod>get_select_method_field_options</selectionMethod>
</formField>
<formField id="bucket_form_field">
<metadata>bucket_metadata</metadata>
<label>bucket_form_field_label</label>
<type>bucket</type>
</formField>
</formFields>
...
<selections>
<selection id="select_form_selection">
...
</selection>
</selections>
...
<methods>
<method id="get_select_method_field_options">
...
</method>
</methods>

Explanation

  • <formFields>: Wrapper element for Form Fields configuration.
  • <formField>: Each <formField> element represents the configuration for a single form field.
    • Attributes:
      • id: The unique ID of the Form Field, which should match the ID configured in the Wizard Step. This attribute is required.
      • Elements:
        • <propertyAttribute>: If the Form Field is mapped to a Publication Property, the key of the property should be specified here.
        • <metadata>: If the Form Field is mapped to a Publication Metadata, the identifier of the metadata should be specified here.
        • <label>: The label of the Form Field. Supports language-dependent translation. This element is required.
        • <type>: The type of Form Field. Available options are text, date, and select. If this element isn't specified, the type of the corresponding property/metadata will be used.
        • <required>: Enable/disable required feature. Default value is false if not configured. For select-type form fields, if the field is not required (i.e., required = false), an empty option will be included as first option in the list of selectable values. This behavior is just applied for the list of value that comes from plugin method.
        • <disabled>: Enable/disable disabled feature. Default value is false if not configured.
        • <selection>: If the Combobox field requires static options, define the ID of the Selection here.
        • <selectionMethod>: If dynamic options are needed for the Combobox field, define the plugin method to fetch the options here.
        • <multiValue>: If the type of the Form Field is select and this flag is true. It means user can select more than one option in the combobox. Default value is false if not configured.
        • <dependencies>: The list of dependent fields
          • <dependency>: Dependent field information
            • <formFieldId>: ID of the form field that is dependent on
        • <validations>: Wrapper element for validation configuration.
        • <validation>: The condition that will be applied to validate the input before it is saved to the server.
          • id: identifier of validation type. Currently, there are 4 type supported: minLength, maxLength, pattern, required.
          • label: The error message is displayed when the input value violates the validation condition. Supports language-dependent translation.