LSPS documentation logo
LSPS Documentation
Data Source Components

Data Source components operate over collections of items, such as, Lists of Records, Shared Records, Set of Strings, etc. and include Table (forms::Table), Grid (forms::Grid), Tree Table (forms::TreeTable), and Repeater (forms::Repeater)

They allow you to visualize data items of such collections in a regular pattern. How the data is obtained is defined by the data source of the component.

With the exception of the Tree Table data source, which requires a data source of types specifically required by the component, the data sources can be defined as:

  • Type: shared Record type (all instances of the shared Record are obtained and used as the data source)
  • Query: query call

    Note: If the query uses paging, the paging is ignored and the paging of the component is used instead.

  • Collection: collection of data items The Collection is calculated only when the form is initialized and remains unchanged on refresh: To reload the data of a collection data source, use the setDataSource() method on the component.

    Note: When applying filtering and sorting on large collections, sorting and filtering actions might cause performance issues: consider using other data sources such as shared Type data sources for large data sets.

  • Custom: custom data source which implements the forms::DataSource interface. The interface requires implementation of the following methods:
    • getCount() returns the number of displayed entries; note that you need to take the filters applied on the data into account. The filters are passed as input arguments.
    • getData() returns the data for the table; note that depending on your requirements, the method will need to filter, sort, and page data;
    • supportFilter() called when the user enters the filter value; The ID of the filters in individual columns is set in the FilterConfig: new FilterConfig(filterId -> "nameColumnFilter")
    • supportSort() called when the user sorts the sort value;

The data items are then used by the component items, for example, rows, as their sources of data. Data items are loaded lazily to allow reasonable performance when working with large data sets.