Class RangeInput

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<RangeInput,Double>
com.vaadin.flow.component.AbstractSinglePropertyField<RangeInput,Double>
com.vaadin.flow.component.html.RangeInput
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<RangeInput>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<RangeInput>, com.vaadin.flow.component.FocusNotifier<RangeInput>, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>, com.vaadin.flow.data.value.HasValueChangeMode, Serializable

@Tag("input") public class RangeInput extends com.vaadin.flow.component.AbstractSinglePropertyField<RangeInput,Double> implements com.vaadin.flow.component.Focusable<RangeInput>, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.data.value.HasValueChangeMode, com.vaadin.flow.component.HasAriaLabel
Creates a new input element with type "range". Note: Slider doesn't support the read-only mode and will disable itself instead.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The orientation of the range slider.

    Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

    com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
  • Field Summary

    Fields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode

    DEFAULT_CHANGE_TIMEOUT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new slider, with ON_CHANGE value change mode.
    RangeInput(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
    Creates a new slider.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the maximum value.
    double
    Gets the minimum value.
    Gets the orientation of the range slider.
    The step attribute is a number that specifies the granularity that the value must adhere to.
    com.vaadin.flow.data.value.ValueChangeMode
     
    int
    The default value is HasValueChangeMode.DEFAULT_CHANGE_TIMEOUT.
    boolean
     
    boolean
     
    void
    setEnabled(boolean enabled)
     
    void
    setMax(double max)
    Sets the new maximum value.
    void
    setMin(double min)
    Sets the new minimum value.
    void
    Sets the orientation of the range slider.
    void
    setReadOnly(boolean readOnly)
     
    void
    The step attribute is a number that specifies the granularity that the value must adhere to.
    void
    setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
     
    void
    setValueChangeTimeout(int valueChangeTimeout)
     

    Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField

    getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent

    Methods inherited from class com.vaadin.flow.component.AbstractField

    addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasAriaLabel

    getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasValue

    clear, getOptionalValue

    Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

    isRequiredIndicatorVisible, setRequiredIndicatorVisible
  • Constructor Details

    • RangeInput

      public RangeInput()
      Creates a new slider, with ON_CHANGE value change mode.
    • RangeInput

      public RangeInput(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
      Creates a new slider.
      Parameters:
      valueChangeMode - initial value change mode, or null to disable the value synchronization
  • Method Details

    • getValueChangeMode

      public com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()
      Specified by:
      getValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeMode
    • setValueChangeMode

      public void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
      Specified by:
      setValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeMode
    • setValueChangeTimeout

      public void setValueChangeTimeout(int valueChangeTimeout)
      Specified by:
      setValueChangeTimeout in interface com.vaadin.flow.data.value.HasValueChangeMode
    • getValueChangeTimeout

      public int getValueChangeTimeout()
      The default value is HasValueChangeMode.DEFAULT_CHANGE_TIMEOUT.
      Specified by:
      getValueChangeTimeout in interface com.vaadin.flow.data.value.HasValueChangeMode
    • getMin

      public double getMin()
      Gets the minimum value.
      Returns:
      the minimum value, defaults to 0.
    • setMin

      public void setMin(double min)
      Sets the new minimum value.
      Parameters:
      min - the minimum value.
    • getMax

      public double getMax()
      Gets the maximum value.
      Returns:
      the maximum value, defaults to 100.
    • setMax

      public void setMax(double max)
      Sets the new maximum value.
      Parameters:
      max - the maximum value.
    • getStep

      public Double getStep()
      The step attribute is a number that specifies the granularity that the value must adhere to. The step attribute can also be set to null. This step value means that no stepping interval is implied and any value is allowed in the specified range The default stepping value for range inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer; for example, if you set min to -10 and value to 1.5, then a step of 1 will allow only values such as 1.5, 2.5, 3.5,… in the positive direction and -0.5, -1.5, -2.5,… in the negative direction.
      Returns:
      the current step value, defaults to 1.
    • setStep

      public void setStep(Double step)
      The step attribute is a number that specifies the granularity that the value must adhere to. The step attribute can also be set to null. This step value means that no stepping interval is implied and any value is allowed in the specified range The default stepping value for range inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer; for example, if you set min to -10 and value to 1.5, then a step of 1 will allow only values such as 1.5, 2.5, 3.5,… in the positive direction and -0.5, -1.5, -2.5,… in the negative direction.
      Parameters:
      step - the new step value, may be null.
    • setOrientation

      public void setOrientation(RangeInput.Orientation orientation)
      Sets the orientation of the range slider. Non-standard Attribute. Since the vertical orientation is not standardized yet, this feature is not guaranteed to work on every browser. We found this feature to work on Firefox 120+, Chromium 119+, Edge 119+ and Safari 17.1+. The orient attribute defines the orientation of the range slider. Values include horizontal, meaning the range is rendered horizontally, and vertical, where the range is rendered vertically.
      Parameters:
      orientation - the orientation, not null. Defaults to RangeInput.Orientation.HORIZONTAL.
    • getOrientation

      public RangeInput.Orientation getOrientation()
      Gets the orientation of the range slider. Non-standard Attribute. The orient attribute defines the orientation of the range slider. Values include horizontal, meaning the range is rendered horizontally, and vertical, where the range is rendered vertically.
      Returns:
      the current orientation, never null.
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RangeInput,Double>,Double>
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface com.vaadin.flow.component.HasEnabled
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface com.vaadin.flow.component.HasEnabled