Interface LazyDataView<T>

Type Parameters:
T - data type
All Superinterfaces:
DataView<T>, Serializable
All Known Implementing Classes:
AbstractLazyDataView, ComboBoxLazyDataView, GridLazyDataView

public interface LazyDataView<T> extends DataView<T>
DataView for lazy loaded data.
Since:
  • Method Details

    • setItemCountFromDataProvider

      void setItemCountFromDataProvider()
      Switches the component to get the exact item count from the data provider's DataProvider.size(Query). Use this when it is cheap to get the exact item count and it is desired that the user sees the "full scrollbar size".
    • setItemCountEstimate

      void setItemCountEstimate(int itemCountEstimate)
      Sets the estimated item count for the component. The component will automatically fetch more items once the estimate is reached or adjust the count if the backend runs out of items before the end. Use this when the backend will have a lot more items than shown by default and it should be shown to the user.

      The given estimate is discarded if it is less than the currently shown range or if the actual number of items has been determined. The estimate shouldn't be less than two pages (see setPageSize(int) in the component) or it causes unnecessary backend requests.

      Parameters:
      itemCountEstimate - estimated item count of the backend
      See Also:
    • getItemCountEstimate

      int getItemCountEstimate()
      Gets the item count estimate. The default value depends on the component.
      Returns:
      item count estimate
      See Also:
    • setItemCountEstimateIncrease

      void setItemCountEstimateIncrease(int itemCountEstimateIncrease)
      Sets how much the item count estimate is increased once the previous item count estimate has been reached. Use this when the user should be able to scroll down faster. The default value depends on the component.

      As an example, with an estimate of 1000 and an increase of 500, when scrolling down the item count will be: 1000, 1500, 2000, 2500... until the backend runs out of items.

      NOTE: the given increase should not be less than the setPageSize(int) set in the component, or there will be unnecessary backend requests.

      Parameters:
      itemCountEstimateIncrease - how much the item count estimate is increased
      See Also:
    • getItemCountEstimateIncrease

      int getItemCountEstimateIncrease()
      Gets the item count estimate increase - how much the item count estimate is increased once the previous item count estimate has been reached. The default value depends on the component.
      Returns:
      the item count estimate increase
      See Also:
    • setItemCountUnknown

      void setItemCountUnknown()
      Switches the component to automatically extend the number of items as the previous end is almost reached. The component stops increasing the number of items once the backend has run out of items. Not getting the exact size of the backend upfront can improve performance with large sets of data.

      The default initial item count and how much the item count is increased depends on the component. These values can be customized with setItemCountEstimate(int) and setItemCountEstimateIncrease(int) when the backend has a lot of items and faster scrolling down is desired.