Interface ValuePicker<V>

All Superinterfaces:
ActionsHolder, Buffered, Component, Component.BelongToFrame, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Field<V>, HasContextHelp, HasFormatter<V>, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasInputPrompt, HasSubParts, HasValidator<V>, HasValue<V>, HasValueSource<V>, Requirable, SupportsUserAction<V>, Validatable
All Known Subinterfaces:
EntityComboBox<V>, EntityPicker<V>, EntitySuggestionField<V>, TagPicker<V>, ValuesPicker<V>
All Known Implementing Classes:
EntityComboBoxImpl, EntityPickerImpl, EntitySuggestionFieldImpl, SearchFieldImpl, TagPickerImpl, ValuePickerImpl, ValuesPickerImpl

@StudioComponent(caption="ValuePicker", category="Components", xmlElement="valuePicker", icon="io/jmix/ui/icon/component/valuePicker.svg", canvasBehaviour=VALUE_PICKER, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/value-picker.html") public interface ValuePicker<V> extends Field<V>, HasFormatter<V>, ActionsHolder, Buffered, Component.Focusable, SupportsUserAction<V>, HasInputPrompt
Generic UI component designed to select and display a value of any type. Consists of the text field and the set of buttons defined by actions.
  • Field Details

  • Method Details

    • of

      static <T> org.springframework.core.ParameterizedTypeReference<ValuePicker<T>> of(Class<T> valueClass)
    • getFieldIconProvider

      @Nullable Function<? super V,String> getFieldIconProvider()
      Returns:
      an icon provider or {code null} if not set
    • setFieldIconProvider

      void setFieldIconProvider(@Nullable Function<? super V,String> iconProvider)
      Sets a function that provides an icon for the field.
      Parameters:
      iconProvider - icon provider to set
    • isFieldEditable

      boolean isFieldEditable()
      Returns:
      whether a user can input the value manually
    • setFieldEditable

      @StudioProperty(name="fieldEditable", defaultValue="false") void setFieldEditable(boolean editable)
      Sets whether a user can input the value manually. false by default. Doesn't set entered value to the model. To handle user input, the ValuePicker.FieldValueChangeEvent listener must be used.
      Parameters:
      editable - true to enable manual input, false otherwise
      See Also:
    • addFieldValueChangeListener

      Subscription addFieldValueChangeListener(Consumer<ValuePicker.FieldValueChangeEvent<V>> listener)
      Adds a listener that will be fired in case field is editable.
      Parameters:
      listener - a listener to add
      Returns:
      a Subscription object
      See Also: