Class AbstractSelectField

All Implemented Interfaces:
IFormField, IAbstractElement, IBlockElement, IElement, IPropertyContainer
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)
  • Method Details

    • addOption

      @Deprecated public void addOption (IBlockElement optionElement)
      Deprecated.
      starting from 8.0.1.
      Add a container with options. This might be a container for options group.
      Parameters:
      optionElement - a container with options.
    • 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.
    • getItems

      public List<SelectFieldItem> getItems()
      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.
    • getOptions

      @Deprecated public List<IBlockElement> getOptions()
      Deprecated.
      starting from 8.0.1.
      Gets a list of containers with option(s). Every container might be a container for options group.
      Returns:
      a list of containers with options.
    • 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.