Class CustomFilterMultiSelectLookupField<T,FilterType>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.Div
com.vaadin.componentfactory.lookupfield.AbstractLookupField<T,Set<T>,com.vaadin.flow.component.combobox.MultiSelectComboBox<T>,CustomFilterMultiSelectLookupField<T,FilterType>,FilterType>
com.vaadin.componentfactory.lookupfield.CustomFilterMultiSelectLookupField<T,FilterType>
- Type Parameters:
T- the type of the items to be inserted in the combo box
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.html.Div>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasOrderedComponents,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasText,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<CustomFilterMultiSelectLookupField<T,,FilterType>, Set<T>>, Set<T>> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<CustomFilterMultiSelectLookupField<T,,FilterType>, Set<T>>, Set<T>> com.vaadin.flow.data.binder.HasFilterableDataProvider<T,,FilterType> com.vaadin.flow.data.binder.HasItems<T>,Serializable
- Direct Known Subclasses:
MultiSelectLookupField
@CssImport("./lookup-dialog-overlay.css")
public class CustomFilterMultiSelectLookupField<T,FilterType>
extends AbstractLookupField<T,Set<T>,com.vaadin.flow.component.combobox.MultiSelectComboBox<T>,CustomFilterMultiSelectLookupField<T,FilterType>,FilterType>
Server-side component for the
vcf-lookup-field webcomponent.
The LookupField is a combination of a combobox and a dialog for advanced search.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.componentfactory.lookupfield.AbstractLookupField
AbstractLookupField.CreateItemEvent, AbstractLookupField.FilterEvent<FILTERTYPE>, AbstractLookupField.LookupFieldI18nNested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
com.vaadin.flow.component.HasText.WhiteSpaceNested 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 class com.vaadin.componentfactory.lookupfield.AbstractLookupField
comboBox, FIELD_SLOT_NAME, filterConverter, invertedFilterConverter, SLOT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionCustomFilterMultiSelectLookupField(com.vaadin.flow.component.grid.Grid<T> grid, com.vaadin.flow.component.combobox.MultiSelectComboBox<T> comboBox, com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter) CustomFilterMultiSelectLookupField(com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter) Constructor The converters are used to convert the backend filter to the combobox filter (String) or if you are using setItemsCustomFilterMultiSelectLookupField(Class<T> beanType, com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter) -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<CustomFilterMultiSelectLookupField<T, FilterType>, Set<T>>> listener) protected voidCopy the selected value of the grid into the fieldprotected voidCopy the selected value of the field into the gridcom.vaadin.flow.component.combobox.MultiSelectComboBox<T> getValue()voidsetComboBox(com.vaadin.flow.component.combobox.MultiSelectComboBox<T> comboBox) Set the comboBoxvoidsetDataProvider(com.vaadin.flow.component.combobox.ComboBox.ItemFilter<T> itemFilter, com.vaadin.flow.data.provider.ListDataProvider<T> listDataProvider) Sets a list data provider with an item filter as the data provider.voidsetDataProvider(com.vaadin.flow.data.provider.ListDataProvider<T> listDataProvider) voidSet the gridvoidsetItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Sets the item label generator that is used to produce the strings shown in the combo box for each item.voidSet the label of the fieldvoidvoidshowSelectedItems(boolean showSelectedItems) Methods inherited from class com.vaadin.componentfactory.lookupfield.AbstractLookupField
addCreateItemListener, addEmptySelectionListener, addFilterListener, addThemeVariants, footerCloseAction, footerSelectAction, getErrorMessage, getGrid, getI18n, getSelectionDisabledIfEmpty, isDraggable, isInvalid, isModal, isResizable, open, setCreateVisible, setDataProvider, setDraggable, setEnabled, setErrorMessage, setFilter, setFooterComponent, setGridWidth, setHeader, setHeaderComponent, setI18n, setInvalid, setItems, setItems, setModal, setReadOnly, setRequiredIndicatorVisible, setResizable, setSelectionDisabledIfEmpty, setThemeVariantsMethods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods 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, 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.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabledMethods inherited from interface com.vaadin.flow.data.binder.HasFilterableDataProvider
setDataProviderMethods inherited from interface com.vaadin.flow.data.binder.HasItems
setItems, setItemsMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods 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.HasText
getText, getWhiteSpace, setText, setWhiteSpaceMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getEmptyValue, getOptionalValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible
-
Constructor Details
-
CustomFilterMultiSelectLookupField
public CustomFilterMultiSelectLookupField(com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter) Constructor The converters are used to convert the backend filter to the combobox filter (String) or if you are using setItems- Parameters:
filterConverter- Convert a string to FilterTypeinvertedFilterConverter- Convert a FilterType to String
-
CustomFilterMultiSelectLookupField
public CustomFilterMultiSelectLookupField(Class<T> beanType, com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter) -
CustomFilterMultiSelectLookupField
public CustomFilterMultiSelectLookupField(com.vaadin.flow.component.grid.Grid<T> grid, com.vaadin.flow.component.combobox.MultiSelectComboBox<T> comboBox, com.vaadin.flow.function.SerializableFunction<String, FilterType> filterConverter, com.vaadin.flow.function.SerializableFunction<FilterType, String> invertedFilterConverter)
-
-
Method Details
-
setGrid
Description copied from class:AbstractLookupFieldSet the grid- Overrides:
setGridin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Parameters:
grid- the grid
-
setValue
-
getValue
-
addValueChangeListener
public com.vaadin.flow.shared.Registration addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<CustomFilterMultiSelectLookupField<T, FilterType>, Set<T>>> listener) -
setComboBox
Set the comboBox- Specified by:
setComboBoxin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Parameters:
comboBox- the comboBox
-
getComboBox
- Specified by:
getComboBoxin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Returns:
- the internal field
-
setDataProvider
- Specified by:
setDataProviderin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType>
-
setDataProvider
public void setDataProvider(com.vaadin.flow.component.combobox.ComboBox.ItemFilter<T> itemFilter, com.vaadin.flow.data.provider.ListDataProvider<T> listDataProvider) Sets a list data provider with an item filter as the data provider.- Specified by:
setDataProviderin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Parameters:
itemFilter- filter to check if an item is shown when user typed some text into the ComboBoxlistDataProvider- the list data provider to use, notnull
-
setItemLabelGenerator
public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Sets the item label generator that is used to produce the strings shown in the combo box for each item. By default,String.valueOf(Object)is used.- Specified by:
setItemLabelGeneratorin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Parameters:
itemLabelGenerator- the item label provider to use, not null
-
setLabel
Set the label of the field- Specified by:
setLabelin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType> - Parameters:
label- label of the field
-
copyFieldValueFromGrid
@ClientCallable protected void copyFieldValueFromGrid()Copy the selected value of the grid into the field- Specified by:
copyFieldValueFromGridin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType>
-
copyFieldValueToGrid
@ClientCallable protected void copyFieldValueToGrid()Copy the selected value of the field into the grid- Specified by:
copyFieldValueToGridin classAbstractLookupField<T,Set<T>, com.vaadin.flow.component.combobox.MultiSelectComboBox<T>, CustomFilterMultiSelectLookupField<T, FilterType>, FilterType>
-
showSelectedItems
public void showSelectedItems(boolean showSelectedItems) - Parameters:
showSelectedItems-
-