Interface PaginationComponent

All Superinterfaces:
Component, Component.BelongToFrame
All Known Subinterfaces:
Pagination, SimplePagination
All Known Implementing Classes:
AbstractPagination, PaginationImpl, SimplePaginationImpl

public interface PaginationComponent extends Component.BelongToFrame
Base interface for components that make a data binding to load data by pages.
  • Method Details

    • getTotalCountDelegate

      @Nullable Supplier<Integer> getTotalCountDelegate()
      Returns:
      delegate which is used to get the total count of items.
    • setTotalCountDelegate

      void setTotalCountDelegate(@Nullable Supplier<Integer> totalCountDelegate)
      Sets delegate which is used to get the total count of items. For instance:
       @Autowired
       private DataManager dataManager;
      
       @Install(to = "pagination", subject = "totalCountDelegate")
       private Integer paginationTotalCountDelegate() {
           return dataManager.loadValue("select count(e) from demo_User e", Integer.class).one();
       }
       
    • getDataBinder

      @Nullable PaginationDataBinder getDataBinder()
      Returns:
      a data binder
    • setDataBinder

      void setDataBinder(PaginationDataBinder dataBinder)
      Sets a data binder. It is used for managing data loading and dividing data to pages.
    • addBeforeRefreshListener

      Subscription addBeforeRefreshListener(Consumer<PaginationComponent.BeforeRefreshEvent> listener)
      Adds before refresh listener. It is invoked when data should be refreshed after user actions: click on navigation buttons (next, last etc), change items per page value.
      Returns:
      a registration object for removing an event listener
    • addAfterRefreshListener

      Subscription addAfterRefreshListener(Consumer<PaginationComponent.AfterRefreshEvent> listener)
      Adds after refresh listener. It is invoked when data is refreshed.
      Returns:
      a registration object for removing an event listener
    • isItemsPerPageVisible

      boolean isItemsPerPageVisible()
      Returns:
      true if items per page ComboBox is visible
    • setItemsPerPageVisible

      @StudioProperty(defaultValue="false") void setItemsPerPageVisible(boolean itemsPerPageVisible)
      Sets visibility of items per page ComboBox. This ComboBox contains options to limit the number of items for one page. If custom options are not set component will use UiComponentProperties.getPaginationItemsPerPageOptions(). The default value is false.
    • isItemsPerPageUnlimitedOptionVisible

      boolean isItemsPerPageUnlimitedOptionVisible()
      Returns:
      true if unlimited (null) option should be visible in the items per page ComboBox.
    • setItemsPerPageUnlimitedOptionVisible

      @StudioProperty(name="itemsPerPageUnlimitedOptionVisible", defaultValue="true") void setItemsPerPageUnlimitedOptionVisible(boolean unlimitedOptionVisible)
      Sets visibility of unlimited (null) option value in the items per page ComboBox. If unlimited (null) option is selected component will try to load data with UiProperties.getEntityMaxFetchSize(String) limitation. The default value is true.
    • getItemsPerPageOptions

      List<Integer> getItemsPerPageOptions()
      Returns:
      items per page options.
    • setItemsPerPageOptions

      @StudioProperty(name="itemsPerPageOptions", type=STRING) void setItemsPerPageOptions(List<Integer> options)
      Sets items per page options which should be used in the ComboBox. Options less than or equal to 0 are ignored, options greater than entity's max fetch size will be replaced by it.
      Parameters:
      options - items per page options
      See Also:
    • getItemsPerPageDefaultValue

      @Nullable Integer getItemsPerPageDefaultValue()
      Returns:
      items per page default value or null
    • setItemsPerPageDefaultValue

      @StudioProperty(name="itemsPerPageDefaultValue", type=INTEGER) void setItemsPerPageDefaultValue(@Nullable Integer defaultValue)
      Sets default value for the items per page ComboBox.