Class IronList<T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.ironlist.IronList<T>
-
- Type Parameters:
T- the type of the items supported by the list
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<IronList<T>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<IronList<T>>,com.vaadin.flow.component.FocusNotifier<IronList<T>>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.data.binder.HasDataProvider<T>,com.vaadin.flow.data.binder.HasItems<T>,Serializable
@Tag("iron-list") @NpmPackage(value="@polymer/iron-list", version="3.1.0") @JsModule("@polymer/iron-list/iron-list.js") @JsModule("./flow-component-renderer.js") @JsModule("./ironListConnector.js") @JsModule("./ironListStyles.js") @Deprecated public class IronList<T> extends com.vaadin.flow.component.Component implements com.vaadin.flow.data.binder.HasDataProvider<T>, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.Focusable<IronList<T>>Deprecated.since Vaadin 21,IronListis deprecated in favor ofVirtualListComponent that encapsulates the functionality of the<iron-list>webcomponent.It supports
DataProviders to load data asynchronously andTemplateRenderers to render the markup for each item.For this component to work properly, it needs to have a well defined
height. It can be an absolute height, like100px, or a relative height inside a container with well defined height.For list rendered in grid layout (setting
setGridLayout(boolean)withtrue), thewidthof the component also needs to be well defined.- Author:
- Vaadin Ltd.
- See Also:
- iron-list webcomponent documentation, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IronList()Deprecated.Creates an empty list.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.vaadin.flow.data.provider.DataCommunicator<T>getDataCommunicator()Deprecated.Returns the data communicator of this list.com.vaadin.flow.data.provider.DataProvider<T,?>getDataProvider()Deprecated.Returns the data provider of this list.TgetPlaceholderItem()Deprecated.Gets the placeholder item of this list, ornullif none has been set.booleanisGridLayout()Deprecated.Gets whether this list is rendered in a grid layout instead of a linear list.voidonEnabledStateChanged(boolean enabled)Deprecated.voidsetDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)Deprecated.voidsetGridLayout(boolean gridLayout)Deprecated.Sets this list to be rendered as a grid.voidsetPlaceholderItem(T placeholderItem)Deprecated.Sets an item to be shown as placeholder in the list while the real data in being fetched from the server.voidsetRenderer(Renderer<T> renderer)Deprecated.Sets a renderer for the items in the list, by using aTemplateRenderer.voidsetRenderer(com.vaadin.flow.function.ValueProvider<T,String> valueProvider)Deprecated.Sets a renderer for the items in the list, by using aValueProvider.-
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, 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.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
-
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
-
-
-
-
Method Detail
-
setDataProvider
public void setDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)
Deprecated.- Specified by:
setDataProviderin interfacecom.vaadin.flow.data.binder.HasDataProvider<T>
-
getDataProvider
public com.vaadin.flow.data.provider.DataProvider<T,?> getDataProvider()
Deprecated.Returns the data provider of this list.- Returns:
- the data provider of this list, not
null
-
getDataCommunicator
public com.vaadin.flow.data.provider.DataCommunicator<T> getDataCommunicator()
Deprecated.Returns the data communicator of this list.- Returns:
- the data communicator, not
null
-
setRenderer
public void setRenderer(com.vaadin.flow.function.ValueProvider<T,String> valueProvider)
Deprecated.Sets a renderer for the items in the list, by using aValueProvider. The String returned by the provider is used to render each item.- Parameters:
valueProvider- a provider for the label string for each item in the list, notnull
-
setRenderer
public void setRenderer(Renderer<T> renderer)
Deprecated.Sets a renderer for the items in the list, by using aTemplateRenderer. The template returned by the renderer is used to render each item.When set, a same renderer is used for the placeholder item. See
setPlaceholderItem(Object)for details.- Parameters:
renderer- a renderer for the items in the list, notnull
-
setPlaceholderItem
public void setPlaceholderItem(T placeholderItem)
Deprecated.Sets an item to be shown as placeholder in the list while the real data in being fetched from the server.Setting a placeholder item improves the user experience of the list while scrolling, since the placeholder uses the same renderer set with
#setRenderer(TemplateRenderer), maintaining the same height for placeholders and actual items.When no placeholder item is set (or when set to
null), an empty placeholder element is created with100pxof width and18pxof height.Note: when using
ComponentTemplateRenderers, the component used for the placeholder is statically stamped in the list. It can not be modified, nor receives any events.- Parameters:
placeholderItem- the item used as placeholder in the list, while the real data is being fetched from the server
-
getPlaceholderItem
public T getPlaceholderItem()
Deprecated.Gets the placeholder item of this list, ornullif none has been set.- Returns:
- the placeholder item
-
isGridLayout
public boolean isGridLayout()
Deprecated.Gets whether this list is rendered in a grid layout instead of a linear list.- Returns:
trueif the list renders itself as a grid,falseotherwise
-
setGridLayout
public void setGridLayout(boolean gridLayout)
Deprecated.Sets this list to be rendered as a grid. Note that for the grid layout to work properly, the component needs to have a well definedwidthandheight.- Parameters:
gridLayout-trueto make the list renders itself as a grid,falseto make it render as a linear list
-
onEnabledStateChanged
public void onEnabledStateChanged(boolean enabled)
Deprecated.- Overrides:
onEnabledStateChangedin classcom.vaadin.flow.component.Component
-
-