THIS - Self-referential generic THISITEM - The item type in the data providerpublic interface FluentHasDataProvider<THIS extends FluentHasDataProvider<THIS,ITEM>,ITEM> extends com.vaadin.data.HasDataProvider<ITEM>, FluentHasItems<THIS,ITEM>
HasDataProviderHasDataProviderFluentComponent.FluentFocusable<C extends FluentComponent.FluentFocusable<C>>com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listenercom.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener| Modifier and Type | Method and Description |
|---|---|
default THIS |
withDataProvider(com.vaadin.data.provider.DataProvider<ITEM,?> dataProvider)
Sets the data provider for this listing.
|
default THIS |
withItems(Collection<ITEM> items)
Sets the data items of this component provided as a collection.
|
withItems, withItemswithCaption, withEnabled, withIcon, withId, withParent, withPrimaryStyleName, withStyleName, withStyleName, withVisibleaddListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerwithFullHeight, withFullSize, withFullWidth, withHeight, withHeight, withSize, withUndefinedHeight, withUndefinedSize, withUndefinedWidth, withWidth, withWidthdefault THIS withItems(Collection<ITEM> items)
FluentHasItems
The provided items are wrapped into a ListDataProvider and this
instance is used as a data provider for the setDataProvider(DataProvider) method.
It means that the items collection can be accessed later on via
ListDataProvider.getItems():
HasDataProvider<String> listing = new CheckBoxGroup<>();
listing.setItems(Arrays.asList("a","b"));
...
Collection<String> collection = ((ListDataProvider<String>)listing.getDataProvider()).getItems();
The provided collection instance may be used as-is. Subsequent modification of the collection might cause inconsistent data to be shown in the component unless it is explicitly instructed to read the data again.
withItems in interface FluentHasItems<THIS extends FluentHasDataProvider<THIS,ITEM>,ITEM>items - the data items to display, not nullHasDataProvider.setItems(Collection)default THIS withDataProvider(com.vaadin.data.provider.DataProvider<ITEM,?> dataProvider)
dataProvider - the data provider, not nullHasDataProvider.setDataProvider(DataProvider)Copyright © 2017 Jean-Christophe Fortier. All rights reserved.