Class AbstractSelectField

All Implemented Interfaces:
IFormField, IAbstractElement, IBlockElement, IElement, IPropertyContainer, IAccessibleElement
Direct Known Subclasses:
ComboBoxField, ListBoxField

public abstract class AbstractSelectField extends FormField<AbstractSelectField>
An abstract class for fields that represents a control for selecting one or several of the provided options.
  • Field Details

  • Constructor Details

    • AbstractSelectField

      protected AbstractSelectField (String id)
      Instantiates a new AbstractSelectField instance.
      Parameters:
      id - the id of the field
  • Method Details

    • addOption

      public void addOption (SelectFieldItem option)
      Add an option to the element.
      Parameters:
      option - a SelectFieldItem
    • addOption

      public void addOption (SelectFieldItem option, boolean selected)
      Add an option to the element.
      Parameters:
      option - a SelectFieldItem
      selected - true is the option if selected, false otherwise
    • getOptions

      public List<SelectFieldItem> getOptions()
      Get a list of SelectFieldItem.
      Returns:
      a list of options.
    • optionsCount

      public int optionsCount()
      Gets the total amount of options available.
      Returns:
      the number of options in the element.
    • hasOptions

      public boolean hasOptions()
      Checks if the element has any options.
      Returns:
      true if the element has options, false otherwise.
    • getOption

      public SelectFieldItem getOption (String value)
      Get an option SelectFieldItem by its string value.
      Parameters:
      value - string value to find an option by
      Returns:
      a SelectFieldItem.
    • hasExportAndDisplayValues

      public boolean hasExportAndDisplayValues()
      Checks if the field has options with export and display values.
      Returns:
      true if the field has options with export and display values, false otherwise.