Class EnhancedDateRangePicker

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<EnhancedDateRangePicker,DateRange>
com.vaadin.flow.component.AbstractSinglePropertyField<EnhancedDateRangePicker,DateRange>
com.vaadin.componentfactory.EnhancedDateRangePicker
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>, com.vaadin.flow.component.shared.HasClearButton, Serializable

@JavaScript("./date-fns-limited.min.js") @JavaScript("./enhancedDateRangePickerConnector.js") @Tag("vcf-date-range-picker") @NpmPackage(value="@vaadin-component-factory/vcf-date-range-picker", version="6.0.0") @JsModule("@vaadin-component-factory/vcf-date-range-picker/vcf-date-range-picker.js") public class EnhancedDateRangePicker extends com.vaadin.flow.component.AbstractSinglePropertyField<EnhancedDateRangePicker,DateRange> implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.shared.HasClearButton, com.vaadin.flow.component.HasLabel
Server-side component that encapsulates the functionality of the vaadin-date-picker webcomponent.

It allows setting and getting LocalDate objects, setting minimum and maximum date ranges and has internationalization support by using the EnhancedDateRangePicker.DatePickerI18n object.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The internationalization properties for EnhancedDateRangePicker.
    static class 
    invalid-changed event is sent when the invalid state changes.
    static class 
    opened-changed event is sent when the overlay opened state changes.

    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.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
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern.
    EnhancedDateRangePicker(DateRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
    Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern and a HasValue.ValueChangeListener.
    EnhancedDateRangePicker(DateRange initialDate, String formattingPattern)
    Convenience Constructor to create a date picker with pre-selected date and pattern setup.
    EnhancedDateRangePicker(DateRange initialDate, String formattingPattern, String... parserPatterns)
    Convenience Constructor to create a date picker with pre-selected date, formatting pattern, and parsing patterns.
    Convenience Constructor to create a date picker with pre-selected date and locale setup.
    EnhancedDateRangePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
    Convenience constructor to create a date picker with a HasValue.ValueChangeListener.
    Convenience constructor to create a date picker with a label.
    Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern and a label.
    EnhancedDateRangePicker(String label, DateRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
    Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern, a HasValue.ValueChangeListener and a label.
    EnhancedDateRangePicker(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
    Convenience constructor to create a date picker with a HasValue.ValueChangeListener and a label.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(com.vaadin.flow.component.Component... components)
     
    com.vaadin.flow.shared.Registration
    addInvalidChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateRangePicker.InvalidChangeEvent> listener)
    Adds a listener for invalid-changed events fired by the webcomponent.
    com.vaadin.flow.shared.Registration
    addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateRangePicker.OpenedChangeEvent> listener)
    Adds a listener for opened-changed events fired by the webcomponent.
    protected void
    Closes the datepicker overlay.
    void
    Deprecated.
     
    protected String
    Gets the end placeholder of the datepicker.
    Gets the current error message from the datepicker.
    Gets the internationalization object previously set for this component.
    Get the visible date when there is no value selected.
    Gets the label of the datepicker.
    Gets the Locale for this date picker
    Gets the maximum date in the date picker.
    Gets the minimum date in the date picker.
    Gets the name of the EnhancedDatePicker.
    Gets the parser patterns for this date-picker
    Gets the Pattern for this date picker
    Gets the placeholder of the datepicker.
    com.vaadin.flow.component.Component
    Gets the component in the prefix slot of this field.
    boolean
    When auto open is enabled, the dropdown will open when the field is clicked.
    boolean
    Gets the validity of the datepicker output.
    boolean
    Gets the states of the drop-down for the datepicker
    boolean
    Determines whether the datepicker is marked as input required.
    boolean
    Returns whether the side panel is currently visible in the date range picker.
    boolean
    Returns whether the text fields are currently visible in the date range picker.
    boolean
    Get the state of showWeekNumbers property of the datepicker
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    void
    Opens the datepicker overlay.
    void
    openOnPosition(int x, int y)
    Opens the datepicker overlay.
    void
    remove(com.vaadin.flow.component.Component... components)
    Removes the given child components from this component.
    void
    Removes all contents from this component, this includes child components, text content as well as child elements that have been added directly to this component using the
    invalid reference
    Element
    API.
    void
     
    void
    setAutoOpen(boolean autoOpen)
    When auto open is enabled, the dropdown will open when the field is clicked.
    void
    setClassNameForDates(String className, LocalDate... dates)
     
    protected void
    setEndPlaceholder(String endPlaceholder)
     
    void
    setErrorMessage(String errorMessage)
     
    void
    Sets the internationalization properties for this component.
    void
    setInitialPosition(LocalDate initialPosition)
    Date which should be visible when there is no value selected.
    void
    setInvalid(boolean invalid)
     
    void
     
    void
    setLocale(Locale locale)
    Set the Locale for the Date Picker.
    void
    Sets the maximum date in the date picker.
    void
    Sets the minimum date in the date picker.
    void
     
    void
    setParsers(String... parserPatterns)
    Setting the patterns for parsing the value of the date-picker.
    void
    setPattern(String formattingPattern)
    Setting the Pattern for formatting value of the date picker
    void
    setPlaceholder(String placeholder)
     
    void
    setPrefixComponent(com.vaadin.flow.component.Component component)
    Adds the given component into this field before the content, replacing any existing prefix component.
    void
    setRequired(boolean required)
     
    void
    setRequiredIndicatorVisible(boolean required)
     
    void
    setSidePanelVisible(boolean sidePanelVisible)
    Sets the visibility of the side panel in the date range picker.
    void
    setTextFieldsVisible(boolean textFieldsVisible)
    Sets the visibility of the text fields in the date range picker.
    void
     
    void
    setWeekNumbersVisible(boolean weekNumbersVisible)
    Set the week number visible in the EnhancedDatePicker.
    protected void
    Performs server-side validation of the current value.

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

    getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent

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

    addValueChangeListener, getValue, isEmpty, setModelValue, valueEquals

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

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, 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.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.shared.HasClearButton

    isClearButtonVisible, setClearButtonVisible

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

    add, add, addComponentAsFirst, addComponentAtIndex, remove

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

    getElement

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

    isEnabled, setEnabled

    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.HasValidation

    setManualValidation

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

    clear, getOptionalValue

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

    isReadOnly, isRequiredIndicatorVisible, setReadOnly
  • Field Details

  • Constructor Details

    • EnhancedDateRangePicker

      public EnhancedDateRangePicker()
      Default constructor.
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(DateRange initialDate)
      Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern.
      Parameters:
      initialDate - the pre-selected date in the picker
      See Also:
      • AbstractField.setValue(Object)
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(String label)
      Convenience constructor to create a date picker with a label.
      Parameters:
      label - the label describing the date picker
      See Also:
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(String label, DateRange initialDate)
      Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern and a label.
      Parameters:
      label - the label describing the date picker
      initialDate - the pre-selected date in the picker
      See Also:
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
      Convenience constructor to create a date picker with a HasValue.ValueChangeListener.
      Parameters:
      listener - the listener to receive value change events
      See Also:
      • AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
      Convenience constructor to create a date picker with a HasValue.ValueChangeListener and a label.
      Parameters:
      label - the label describing the date picker
      listener - the listener to receive value change events
      See Also:
      • setLabel(String)
      • AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(DateRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
      Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern and a HasValue.ValueChangeListener.
      Parameters:
      initialDate - the pre-selected date in the picker
      listener - the listener to receive value change events
      See Also:
      • AbstractField.setValue(Object)
      • AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(String label, DateRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>> listener)
      Convenience constructor to create a date picker with a pre-selected date in current UI locale setPattern, a HasValue.ValueChangeListener and a label.
      Parameters:
      label - the label describing the date picker
      initialDate - the pre-selected date in the picker
      listener - the listener to receive value change events
      See Also:
      • setLabel(String)
      • AbstractField.setValue(Object)
      • AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(DateRange initialDate, Locale locale)
      Convenience Constructor to create a date picker with pre-selected date and locale setup.
      Parameters:
      initialDate - the pre-selected date in the picker
      locale - the locale for the date picker
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(DateRange initialDate, String formattingPattern)
      Convenience Constructor to create a date picker with pre-selected date and pattern setup.
      Parameters:
      initialDate - the pre-selected date in the picker
      formattingPattern - the pattern for formatting value of the date picker
    • EnhancedDateRangePicker

      public EnhancedDateRangePicker(DateRange initialDate, String formattingPattern, String... parserPatterns)
      Convenience Constructor to create a date picker with pre-selected date, formatting pattern, and parsing patterns.
      Parameters:
      initialDate - the pre-selected date in the picker
      formattingPattern - the pattern for formatting value of the date picker
      parserPatterns - the array of patterns used for parsing the date picker's value
  • Method Details

    • disableClientValidation

      @Deprecated public void disableClientValidation()
      Deprecated.
      EnhancedDatePicker has workaround to this issue https://github.com/vaadin/vaadin-date-picker-flow/issues/223 Calling disableClientValidation() after instantiation will make EnhancedDatePicker to behave similar way as regular DatePicker with client side validations. This method is provided if you need to retain that behavior instead.
    • setMin

      public void setMin(LocalDate min)
      Sets the minimum date in the date picker. Dates before that will be disabled in the popup.
      Parameters:
      min - the minimum date that is allowed to be selected, or null to remove any minimum constraints
    • getMin

      public LocalDate getMin()
      Gets the minimum date in the date picker. Dates before that will be disabled in the popup.
      Returns:
      the minimum date that is allowed to be selected, or null if there's no minimum
    • setMax

      public void setMax(LocalDate max)
      Sets the maximum date in the date picker. Dates after that will be disabled in the popup.
      Parameters:
      max - the maximum date that is allowed to be selected, or null to remove any maximum constraints
    • getMax

      public LocalDate getMax()
      Gets the maximum date in the date picker. Dates after that will be disabled in the popup.
      Returns:
      the maximum date that is allowed to be selected, or null if there's no maximum
    • setLocale

      public void setLocale(Locale locale)
      Set the Locale for the Date Picker. The displayed date will be matched to the format used in that locale. If this method is never called, the Locale will default to the UI's Locale.

      NOTE:Supported formats are MM/DD/YYYY, DD/MM/YYYY and YYYY/MM/DD. Browser compatibility can be different based on the browser and mobile devices, you can check here for more details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString

      Parameters:
      locale - the locale set to the date picker, cannot be null
    • getLocale

      public Locale getLocale()
      Gets the Locale for this date picker
      Overrides:
      getLocale in class com.vaadin.flow.component.Component
      Returns:
      the locale used for this picker
    • setParsers

      public void setParsers(String... parserPatterns)
      Setting the patterns for parsing the value of the date-picker. The parsing will be attempted according to the order of the supplied patterns. If none of these patterns can successfully parse the date-picker's value, the parsing will, first, be attempted using the formatting value (which can be set using @setPattern). If the latter also fails, parsing will be attempted using the Locale (which can be set using @setLocale).
      Parameters:
      parserPatterns - the array of patterns used for parsing the date picker's value
    • getParsers

      public String[] getParsers()
      Gets the parser patterns for this date-picker
      Returns:
      an array of the parser patterns used for formatting value of the date picker
    • setPattern

      public void setPattern(String formattingPattern)
      Setting the Pattern for formatting value of the date picker
      Parameters:
      formattingPattern - the pattern for formatting value of the date picker if set to null or empty string then for matting will be done by Locale
    • setClassNameForDates

      public void setClassNameForDates(String className, LocalDate... dates)
    • getPattern

      public String getPattern()
      Gets the Pattern for this date picker
      Returns:
      the pattern for formatting value of the date picker
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • getI18n

      Gets the internationalization object previously set for this component.

      Note: updating the object content that is gotten from this method will not update the lang on the component if not set back using setI18n(DatePickerI18n)

      Returns:
      the i18n object. It will be null, If the i18n properties weren't set.
    • setI18n

      public void setI18n(EnhancedDateRangePicker.DatePickerI18n i18n)
      Sets the internationalization properties for this component.
      Parameters:
      i18n - the internationalized properties, not null
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.HasValidation
    • getErrorMessage

      public String getErrorMessage()
      Gets the current error message from the datepicker.
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.HasValidation
      Returns:
      the current error message
    • setInvalid

      public void setInvalid(boolean invalid)
      Specified by:
      setInvalid in interface com.vaadin.flow.component.HasValidation
    • isInvalid

      public boolean isInvalid()
      Gets the validity of the datepicker output.

      return true, if the value is invalid.

      Specified by:
      isInvalid in interface com.vaadin.flow.component.HasValidation
      Returns:
      the validity property from the datepicker
    • setSidePanelVisible

      public void setSidePanelVisible(boolean sidePanelVisible)
      Sets the visibility of the side panel in the date range picker.

      The side panel typically includes shortcuts or additional controls.

      Parameters:
      sidePanelVisible - true to show the side panel, false to hide it
    • isTextFieldsVisible

      public boolean isTextFieldsVisible()
      Returns whether the text fields are currently visible in the date range picker.
      Returns:
      true if the text fields are visible, false otherwise
      See Also:
    • setTextFieldsVisible

      public void setTextFieldsVisible(boolean textFieldsVisible)
      Sets the visibility of the text fields in the date range picker.

      Text fields allow manual entry of the date values.

      Parameters:
      textFieldsVisible - true to show the text fields, false to hide them
    • isSidePanelVisible

      public boolean isSidePanelVisible()
      Returns whether the side panel is currently visible in the date range picker.
      Returns:
      true if the side panel is visible, false otherwise
      See Also:
    • setLabel

      public void setLabel(String label)
      Specified by:
      setLabel in interface com.vaadin.flow.component.HasLabel
    • getLabel

      public String getLabel()
      Gets the label of the datepicker.
      Specified by:
      getLabel in interface com.vaadin.flow.component.HasLabel
      Returns:
      the label property of the datePicker
    • setPlaceholder

      public void setPlaceholder(String placeholder)
    • setEndPlaceholder

      protected void setEndPlaceholder(String endPlaceholder)
    • getPlaceholder

      public String getPlaceholder()
      Gets the placeholder of the datepicker.

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the placeholder property of the datePicker
    • getEndPlaceholder

      protected String getEndPlaceholder()
      Gets the end placeholder of the datepicker.

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the placeholder property of the datePicker
    • setInitialPosition

      public void setInitialPosition(LocalDate initialPosition)
      Date which should be visible when there is no value selected.

      The same date formats as for the value property are supported.

      Parameters:
      initialPosition - the LocalDate value to set
    • getInitialPosition

      public LocalDate getInitialPosition()
      Get the visible date when there is no value selected.

      The same date formats as for the value property are supported.

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the initialPosition property from the datepicker
    • setRequired

      public void setRequired(boolean required)
    • setRequiredIndicatorVisible

      public void setRequiredIndicatorVisible(boolean required)
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>
    • isRequired

      public boolean isRequired()
      Determines whether the datepicker is marked as input required.

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      true if the input is required, false otherwise
    • setWeekNumbersVisible

      public void setWeekNumbersVisible(boolean weekNumbersVisible)
      Set the week number visible in the EnhancedDatePicker.

      Set true to display ISO-8601 week numbers in the calendar.

      Notice that displaying week numbers is only supported when i18n.firstDayOfWeek is 1 (Monday).

      Parameters:
      weekNumbersVisible - the boolean value to set
    • isWeekNumbersVisible

      public boolean isWeekNumbersVisible()
      Get the state of showWeekNumbers property of the datepicker

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the showWeekNumbers property from the datepicker
    • open

      public void open()
      Opens the datepicker overlay.
    • openOnPosition

      public void openOnPosition(int x, int y)
      Opens the datepicker overlay.
    • close

      protected void close()
      Closes the datepicker overlay.
    • isOpened

      public boolean isOpened()
      Gets the states of the drop-down for the datepicker
      Returns:
      true if the drop-down is opened, false otherwise
    • setAutoOpen

      public void setAutoOpen(boolean autoOpen)
      When auto open is enabled, the dropdown will open when the field is clicked.
      Parameters:
      autoOpen - Value for the auto open property,
    • isAutoOpen

      public boolean isAutoOpen()
      When auto open is enabled, the dropdown will open when the field is clicked.
      Returns:
      true if auto open is enabled. false otherwise. Default is true
    • setName

      public void setName(String name)
    • validate

      protected void validate()
      Performs server-side validation of the current value. This is needed because it is possible to circumvent the client-side validation constraints using browser development tools.
    • getName

      public String getName()
      Gets the name of the EnhancedDatePicker.
      Returns:
      the name property from the EnhancedDatePicker
    • addOpenedChangeListener

      public com.vaadin.flow.shared.Registration addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateRangePicker.OpenedChangeEvent> listener)
      Adds a listener for opened-changed events fired by the webcomponent.
      Parameters:
      listener - the listener
      Returns:
      a Registration for removing the event listener
    • addInvalidChangeListener

      public com.vaadin.flow.shared.Registration addInvalidChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateRangePicker.InvalidChangeEvent> listener)
      Adds a listener for invalid-changed events fired by the webcomponent.
      Parameters:
      listener - the listener
      Returns:
      a Registration for removing the event listener
    • setPrefixComponent

      public void setPrefixComponent(com.vaadin.flow.component.Component component)
      Adds the given component into this field before the content, replacing any existing prefix component.

      This is most commonly used to add a simple icon or static text into the field.

      Parameters:
      component - the component to set, can be null to remove existing prefix component
    • getPrefixComponent

      public com.vaadin.flow.component.Component getPrefixComponent()
      Gets the component in the prefix slot of this field.
      Returns:
      the prefix component of this field, or null if no prefix component has been set
      See Also:
    • removeAll

      public void removeAll()
      Removes all contents from this component, this includes child components, text content as well as child elements that have been added directly to this component using the
      invalid reference
      Element
      API.
      Specified by:
      removeAll in interface com.vaadin.flow.component.HasComponents
    • remove

      public void remove(com.vaadin.flow.component.Component... components)
      Removes the given child components from this component.
      Specified by:
      remove in interface com.vaadin.flow.component.HasComponents
      Parameters:
      components - The components to remove.
      Throws:
      IllegalArgumentException - if any of the components is not a child of this component.
    • add

      public void add(com.vaadin.flow.component.Component... components)
      Specified by:
      add in interface com.vaadin.flow.component.HasComponents
    • removePresetByIds

      public void removePresetByIds(String... ids)
    • setValue

      public void setValue(DateRange value)
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>
      Overrides:
      setValue in class com.vaadin.flow.component.AbstractField<EnhancedDateRangePicker,DateRange>
    • getEmptyValue

      public DateRange getEmptyValue()
      Specified by:
      getEmptyValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateRangePicker,DateRange>,DateRange>
      Overrides:
      getEmptyValue in class com.vaadin.flow.component.AbstractField<EnhancedDateRangePicker,DateRange>