Class EnhancedDateTimeRangePicker
- 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<EnhancedDateTimeRangePicker,,DateTimeRange>, DateTimeRange> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker,,DateTimeRange>, DateTimeRange> com.vaadin.flow.component.shared.HasClearButton,Serializable
vcf-date-time-range-picker webcomponent.
It allows setting and getting LocalDateTime objects, setting minimum and maximum date
ranges and has internationalization support by using the EnhancedDateTimeRangePicker.DatePickerI18n object.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe internationalization properties forEnhancedDateTimeRangePicker.static classinvalid-changedevent is sent when the invalid state changes.static classopened-changedevent 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 extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.EnhancedDateTimeRangePicker(DateTimeRange initialDate) Convenience constructor to create a date time range picker with a pre-selected date time range in current UI locale setPattern.EnhancedDateTimeRangePicker(DateTimeRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern and aHasValue.ValueChangeListener.EnhancedDateTimeRangePicker(DateTimeRange initialDate, String formattingPattern) Convenience Constructor to create a date-time range picker with pre-selected date and pattern setup.EnhancedDateTimeRangePicker(DateTimeRange initialDate, String formattingPattern, String... parserPatterns) Convenience Constructor to create a date-time range picker with pre-selected date, formatting pattern, and parsing patterns.EnhancedDateTimeRangePicker(DateTimeRange initialDate, Locale locale) Convenience Constructor to create a date-time range picker with pre-selected date and locale setup.EnhancedDateTimeRangePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with aHasValue.ValueChangeListener.Convenience constructor to create a date-time range picker with a label.EnhancedDateTimeRangePicker(String label, DateTimeRange initialDate) Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern and a label.EnhancedDateTimeRangePicker(String label, DateTimeRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern, aHasValue.ValueChangeListenerand a label.EnhancedDateTimeRangePicker(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with aHasValue.ValueChangeListenerand a label. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.vaadin.flow.component.Component... components) com.vaadin.flow.shared.RegistrationaddInvalidChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateTimeRangePicker.InvalidChangeEvent> listener) Adds a listener forinvalid-changedevents fired by the webcomponent.com.vaadin.flow.shared.RegistrationaddOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateTimeRangePicker.OpenedChangeEvent> listener) Adds a listener foropened-changedevents fired by the webcomponent.protected voidclose()Closes the date-time range picker overlay.voidDeprecated.Gets the placeholder of the end date part of the date-time range picker.protected StringGets the placeholder of the end time part of the date-time range picker.Gets the current error message from the datepicker.getI18n()Gets the internationalization object previously set for this component.Get the visible date when there is no value selected.getLabel()Gets the label of the date-time range picker.Gets the Locale for this date pickergetMax()Gets the maximum date in the picker.getMin()Gets the minimum date in the picker.getName()Gets the name of the EnhancedDatePicker.String[]Gets the parser patterns for this date-pickerGets the Pattern for this date pickercom.vaadin.flow.component.ComponentGets the component in the prefix slot of this field.Gets the placeholder of the start date part of the date-time range picker.protected StringGets the placeholder of the start time part of the date-time range picker.booleanWhen auto open is enabled, the dropdown will open when the field is clicked.booleanGets the validity of the date-time range picker date value output.booleanisOpened()Gets the states of the drop-down for the date-time range pickerbooleanDetermines whether the date-time picker is marked as input required.booleanReturns whether the side panel is currently visible in the date-time range picker.booleanReturns whether the text fields are currently visible in the date-time range picker.booleanGet the state ofshowWeekNumbersproperty of the datepickerprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidopen()Opens the date-time range picker overlay.voidopenOnPosition(int x, int y) Opens the date-time range picker overlay.voidremove(com.vaadin.flow.component.Component... components) Removes the given child components from this component.voidRemoves 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 theElementAPI.voidremovePresetByIds(String... ids) voidsetAutoOpen(boolean autoOpen) When auto open is enabled, the dropdown will open when the field is clicked.voidsetClassNameForDates(String className, LocalDate... dates) voidsetEndDatePlaceholder(String endDatePlaceholder) Sets the placeholder for the end date part of the date-time range picker.voidsetEndTimePlaceholder(String endDatePlaceholder) Sets the placeholder for the end time part of the date-time range picker.voidsetErrorMessage(String errorMessage) voidSets the internationalization properties for this component.voidsetInitialPosition(LocalDate initialPosition) Date which should be visible when there is no value selected.voidsetInvalid(boolean invalid) voidSets the label for the date-time range picker.voidSet the Locale for the Date Picker.voidSets the maximum date in the picker.voidSets the minimum date in the picker.voidvoidsetParsers(String... parserPatterns) Setting the patterns for parsing the value of the date in the picker.voidsetPattern(String formattingPattern) Setting the Pattern for formatting value of the date pickervoidsetPrefixComponent(com.vaadin.flow.component.Component component) Adds the given component into this field before the content, replacing any existing prefix component.voidsetRequired(boolean required) voidsetRequiredIndicatorVisible(boolean required) voidsetSidePanelVisible(boolean sidePanelVisible) Sets the visibility of the side panel in the date-time range picker.voidsetStartDatePlaceholder(String startDatePlaceholder) Sets the placeholder for the start date part of the date-time range picker.voidsetStartTimePlaceholder(String startTimePlaceholder) Sets the placeholder for the start time part of the date-time range picker.voidsetTextFieldsVisible(boolean textFieldsVisible) Sets the visibility of the text fields in the date-time range picker.voidsetValue(DateTimeRange value) voidsetWeekNumbersVisible(boolean weekNumbersVisible) Set the week number visible in the EnhancedDateTimeRangePicker.protected voidvalidate()Performs server-side validation of the current value.Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getValue, isEmpty, setModelValue, valueEqualsMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
isClearButtonVisible, setClearButtonVisibleMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly
-
Field Details
-
PRESET_TODAY
- See Also:
-
PRESET_YESTERDAY
- See Also:
-
PRESET_THIS_WEEK
- See Also:
-
PRESET_LAST_WEEK
- See Also:
-
PRESET_THIS_MONTH
- See Also:
-
PRESET_LAST_MONTH
- See Also:
-
PRESET_THIS_YEAR
- See Also:
-
PRESET_LAST_YEAR
- See Also:
-
PRESET_CANCEL_BUTTON
- See Also:
-
-
Constructor Details
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker()Default constructor. -
EnhancedDateTimeRangePicker
Convenience constructor to create a date time range picker with a pre-selected date time range in current UI locale setPattern.- Parameters:
initialDate- the pre-selected date time range in the picker- See Also:
-
AbstractField.setValue(Object)
-
EnhancedDateTimeRangePicker
Convenience constructor to create a date-time range picker with a label.- Parameters:
label- the label describing the date-time range picker- See Also:
-
EnhancedDateTimeRangePicker
Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern and a label.- Parameters:
label- the label describing the date pickerinitialDate- the pre-selected date in the picker- See Also:
-
AbstractField.setValue(Object)setLabel(String)
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker(com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with aHasValue.ValueChangeListener.- Parameters:
listener- the listener to receive value change events- See Also:
-
AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with aHasValue.ValueChangeListenerand a label.- Parameters:
label- the label describing the date pickerlistener- the listener to receive value change events- See Also:
-
setLabel(String)AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker(DateTimeRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern and aHasValue.ValueChangeListener.- Parameters:
initialDate- the pre-selected date in the pickerlistener- the listener to receive value change events- See Also:
-
AbstractField.setValue(Object)AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker(String label, DateTimeRange initialDate, com.vaadin.flow.component.HasValue.ValueChangeListener<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker, DateTimeRange>> listener) Convenience constructor to create a date-time range picker with a pre-selected date in current UI locale setPattern, aHasValue.ValueChangeListenerand a label.- Parameters:
label- the label describing the date pickerinitialDate- the pre-selected date in the pickerlistener- the listener to receive value change events- See Also:
-
setLabel(String)AbstractField.setValue(Object)AbstractField.addValueChangeListener(HasValue.ValueChangeListener)
-
EnhancedDateTimeRangePicker
Convenience Constructor to create a date-time range picker with pre-selected date and locale setup.- Parameters:
initialDate- the pre-selected date-ime in the pickerlocale- the locale for the picker
-
EnhancedDateTimeRangePicker
Convenience Constructor to create a date-time range picker with pre-selected date and pattern setup.- Parameters:
initialDate- the pre-selected date in the pickerformattingPattern- the pattern for formatting value of the picker
-
EnhancedDateTimeRangePicker
public EnhancedDateTimeRangePicker(DateTimeRange initialDate, String formattingPattern, String... parserPatterns) Convenience Constructor to create a date-time range picker with pre-selected date, formatting pattern, and parsing patterns.- Parameters:
initialDate- the pre-selected date in the pickerformattingPattern- the pattern for formatting value of the date pickerparserPatterns- the array of patterns used for parsing the date picker's value
-
-
Method Details
-
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
Sets the minimum date in the picker. Dates before that will be disabled in the popup.- Parameters:
min- the minimum date that is allowed to be selected, ornullto remove any minimum constraints
-
getMin
Gets the minimum date in the picker. Dates before that will be disabled in the popup.- Returns:
- the minimum date that is allowed to be selected, or
nullif there's no minimum
-
setMax
Sets the maximum date in the picker. Dates after that will be disabled in the popup.- Parameters:
max- the maximum date that is allowed to be selected, ornullto remove any maximum constraints
-
getMax
Gets the maximum date in the picker. Dates after that will be disabled in the popup.- Returns:
- the maximum date that is allowed to be selected, or
nullif there's no maximum
-
setLocale
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
Gets the Locale for this date picker- Overrides:
getLocalein classcom.vaadin.flow.component.Component- Returns:
- the locale used for this picker
-
setParsers
Setting the patterns for parsing the value of the date in the 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
Gets the parser patterns for this date-picker- Returns:
- an array of the parser patterns used for formatting value of the date picker
-
setPattern
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
-
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:
onAttachin classcom.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
Sets the internationalization properties for this component.- Parameters:
i18n- the internationalized properties, notnull
-
setErrorMessage
- Specified by:
setErrorMessagein interfacecom.vaadin.flow.component.HasValidation
-
getErrorMessage
Gets the current error message from the datepicker.- Specified by:
getErrorMessagein interfacecom.vaadin.flow.component.HasValidation- Returns:
- the current error message
-
setInvalid
public void setInvalid(boolean invalid) - Specified by:
setInvalidin interfacecom.vaadin.flow.component.HasValidation
-
isInvalid
public boolean isInvalid()Gets the validity of the date-time range picker date value output.return true, if the value is invalid.
- Specified by:
isInvalidin interfacecom.vaadin.flow.component.HasValidation- Returns:
- the
validityproperty from the date-time range picker
-
setSidePanelVisible
public void setSidePanelVisible(boolean sidePanelVisible) Sets the visibility of the side panel in the date-time range picker.The side panel typically includes shortcuts or additional controls.
- Parameters:
sidePanelVisible-trueto show the side panel,falseto hide it
-
isSidePanelVisible
public boolean isSidePanelVisible()Returns whether the side panel is currently visible in the date-time range picker.- Returns:
trueif the side panel is visible,falseotherwise- See Also:
-
setTextFieldsVisible
public void setTextFieldsVisible(boolean textFieldsVisible) Sets the visibility of the text fields in the date-time range picker.Text fields allow manual entry of the date and time values.
- Parameters:
textFieldsVisible-trueto show the text fields,falseto hide them
-
isTextFieldsVisible
public boolean isTextFieldsVisible()Returns whether the text fields are currently visible in the date-time range picker.- Returns:
trueif the text fields are visible,falseotherwise- See Also:
-
setLabel
Sets the label for the date-time range picker.- Specified by:
setLabelin interfacecom.vaadin.flow.component.HasLabel- Parameters:
label- the label for the date-time range picker
-
getLabel
Gets the label of the date-time range picker.- Specified by:
getLabelin interfacecom.vaadin.flow.component.HasLabel- Returns:
- the
labelproperty of the date-time range picker
-
setStartDatePlaceholder
Sets the placeholder for the start date part of the date-time range picker.- Parameters:
startDatePlaceholder- the placeholder for the start date part of the date-time range picker
-
setEndDatePlaceholder
Sets the placeholder for the end date part of the date-time range picker.- Parameters:
endDatePlaceholder- the placeholder for the end date part of the date-time range picker
-
getStartDatePlaceholder
Gets the placeholder of the start date part of the date-time range picker.- Returns:
- the
startDatePlaceholderproperty of the date-time range picker
-
getEndDatePlaceholder
Gets the placeholder of the end date part of the date-time range picker.- Returns:
- the
endDatePlaceholderproperty of the date-time range picker
-
setStartTimePlaceholder
Sets the placeholder for the start time part of the date-time range picker.- Parameters:
startTimePlaceholder- the placeholder for the start time part of the date-time range picker
-
setEndTimePlaceholder
Sets the placeholder for the end time part of the date-time range picker.- Parameters:
endDatePlaceholder- the placeholder for the end time part of the date-time range picker
-
getStartTimePlaceholder
Gets the placeholder of the start time part of the date-time range picker.- Returns:
- the
startTimePlaceholderproperty of the date-time range picker
-
getEndTimePlaceholder
Gets the placeholder of the end time part of the date-time range picker.- Returns:
- the
endTimePlaceholderproperty of the date-time range picker
-
setInitialPosition
Date which should be visible when there is no value selected.The same date formats as for the
valueproperty are supported.- Parameters:
initialPosition- the LocalDate value to set
-
getInitialPosition
Get the visible date when there is no value selected.The same date formats as for the
valueproperty 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
initialPositionproperty from the datepicker
-
setRequired
public void setRequired(boolean required) -
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean required) - Specified by:
setRequiredIndicatorVisiblein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker,DateTimeRange>, DateTimeRange> - Specified by:
setRequiredIndicatorVisiblein interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker,DateTimeRange>, DateTimeRange>
-
isRequired
public boolean isRequired()Determines whether the date-time picker 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:
trueif the input is required,falseotherwise
-
setWeekNumbersVisible
public void setWeekNumbersVisible(boolean weekNumbersVisible) Set the week number visible in the EnhancedDateTimeRangePicker.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 ofshowWeekNumbersproperty of the datepickerThis property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
showWeekNumbersproperty from the date-time range picker
-
open
public void open()Opens the date-time range picker overlay. -
openOnPosition
public void openOnPosition(int x, int y) Opens the date-time range picker overlay. -
close
protected void close()Closes the date-time range picker overlay. -
isOpened
public boolean isOpened()Gets the states of the drop-down for the date-time range picker- Returns:
trueif the drop-down is opened,falseotherwise
-
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:
trueif auto open is enabled.falseotherwise. Default istrue
-
setName
-
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
Gets the name of the EnhancedDatePicker.- Returns:
- the
nameproperty from the EnhancedDatePicker
-
addOpenedChangeListener
public com.vaadin.flow.shared.Registration addOpenedChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateTimeRangePicker.OpenedChangeEvent> listener) Adds a listener foropened-changedevents fired by the webcomponent.- Parameters:
listener- the listener- Returns:
- a
Registrationfor removing the event listener
-
addInvalidChangeListener
public com.vaadin.flow.shared.Registration addInvalidChangeListener(com.vaadin.flow.component.ComponentEventListener<EnhancedDateTimeRangePicker.InvalidChangeEvent> listener) Adds a listener forinvalid-changedevents fired by the webcomponent.- Parameters:
listener- the listener- Returns:
- a
Registrationfor 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 benullto 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
nullif 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 theElementAPI.- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponents
-
remove
public void remove(com.vaadin.flow.component.Component... components) Removes the given child components from this component.- Specified by:
removein interfacecom.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:
addin interfacecom.vaadin.flow.component.HasComponents
-
removePresetByIds
-
setValue
- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker,DateTimeRange>, DateTimeRange> - Overrides:
setValuein classcom.vaadin.flow.component.AbstractField<EnhancedDateTimeRangePicker,DateTimeRange>
-
getEmptyValue
- Specified by:
getEmptyValuein interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedDateTimeRangePicker,DateTimeRange>, DateTimeRange> - Overrides:
getEmptyValuein classcom.vaadin.flow.component.AbstractField<EnhancedDateTimeRangePicker,DateTimeRange>
-