Interface ComboBox<V>

Type Parameters:
V - type of options and value
All Superinterfaces:
Buffered, Component, Component.BelongToFrame, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Field<V>, HasContextHelp, HasEnterPressHandler, HasFilterMode, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasInputPrompt, HasOptionCaptionProvider<V>, HasOptionIconProvider<V>, HasOptionImageProvider<V>, HasOptionStyleProvider<V>, HasValidator<V>, HasValue<V>, HasValueSource<V>, OptionsField<V,V>, Requirable, Validatable
All Known Subinterfaces:
EntityComboBox<V>
All Known Implementing Classes:
ComboBoxImpl, EntityComboBoxImpl

@StudioComponent(caption="ComboBox", category="Components", xmlElement="comboBox", icon="io/jmix/ui/icon/component/comboBox.svg", canvasBehaviour=COMBO_BOX, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/combo-box.html") public interface ComboBox<V> extends OptionsField<V,V>, HasInputPrompt, Buffered, Component.Focusable, HasOptionStyleProvider<V>, HasOptionIconProvider<V>, HasOptionImageProvider<V>, HasFilterMode, HasEnterPressHandler
A filtering dropdown single-select component. Items are filtered based on user input.
  • Field Details

  • Method Details

    • of

      static <T> org.springframework.core.ParameterizedTypeReference<ComboBox<T>> of(Class<T> valueClass)
    • getNullSelectionCaption

      String getNullSelectionCaption()
      Returns:
      the null selection caption, not null
    • setNullSelectionCaption

      @StudioProperty(name="nullName", type=LOCALIZED_STRING) void setNullSelectionCaption(String nullOption)
      Sets the null selection caption.

      The empty string "" is the default null selection caption.

      If null selection is allowed then the null item will be shown with the given caption.

      Parameters:
      nullOption - the caption to set, not null
    • isTextInputAllowed

      boolean isTextInputAllowed()
      Returns:
      true if text input allowed
    • setTextInputAllowed

      @StudioProperty(defaultValue="true") void setTextInputAllowed(boolean textInputAllowed)
      Sets whether it is possible to input text into the field or whether the field area of the component is just used to show what is selected.
    • setAutomaticPopupOnFocus

      void setAutomaticPopupOnFocus(boolean automaticPopupOnFocus)
      When enabled popup automatically opens on focus.
    • isAutomaticPopupOnFocus

      boolean isAutomaticPopupOnFocus()
      Returns:
      whether popup is automatically shows on focus.
    • getPageLength

      int getPageLength()
      Returns:
      the page length of the suggestion popup.
    • setPageLength

      @StudioProperty(defaultValue="10") @PositiveOrZero void setPageLength(int pageLength)
      Sets the page length for the suggestion popup. Setting the page length to 0 will disable suggestion popup paging (all items visible).
      Parameters:
      pageLength - the pageLength to set
    • setNullOptionVisible

      @StudioProperty(defaultValue="true") void setNullOptionVisible(boolean nullOptionVisible)
      Sets visibility for first null element in suggestion popup.
    • isNullOptionVisible

      boolean isNullOptionVisible()
      Returns:
      true if first null element is visible.
    • getPopupWidth

      @Nullable String getPopupWidth()
      Returns the suggestion popup's width as a string. By default this width is set to null.
      Returns:
      explicitly set popup width as size string or null if not set
    • setPopupWidth

      void setPopupWidth(@Nullable String width)
      Sets the suggestion popup's width as a string. By using relative units (e.g. "50%") it's possible to set the popup's width relative to the LookupField itself.

      By default this width is set to null so that the popup's width can be greater than a component width to fit the content of all displayed items. By setting width to "100%" the popup's width will be equal to the width of the LookupField.

      Parameters:
      width - the width
    • getOptionsCaptionFilter

      @Nullable Predicate<ComboBox.OptionsCaptionFilteringContext> getOptionsCaptionFilter()
      Returns:
      a predicate that tests whether an item with the given caption matches to the given search string.
    • setOptionsCaptionFilter

      void setOptionsCaptionFilter(@Nullable Predicate<ComboBox.OptionsCaptionFilteringContext> filter)
      Sets a predicate that tests whether an item with the given caption matches to the given search string.
      Parameters:
      filter - a predicate to set