Interface PaginationComponent<T extends AbstractPagination>

All Known Implementing Classes:
SimplePagination

public interface PaginationComponent<T extends AbstractPagination>
Base interface for components that make a data binding to load data by pages.
  • Method Details

    • getPaginationLoader

      @Nullable PaginationDataLoader getPaginationLoader()
      Returns:
      pagination data loader or null if not set
    • setPaginationLoader

      void setPaginationLoader(@Nullable PaginationDataLoader loader)
      Sets loader to the component.
      Parameters:
      loader - pagination data loader to set
    • getTotalCountDelegate

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

      void setTotalCountDelegate(@Nullable Function<LoadContext,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(LoadContext<User> dataLoadContext) {
           return dataManager.loadValue("select count(e) from demo_User e", Integer.class).one();
       }
       
      Parameters:
      totalCountDelegate - total count delegate to set
    • addBeforeRefreshListener

      com.vaadin.flow.shared.Registration addBeforeRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.BeforeRefreshEvent<T>> 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.
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener
    • addAfterRefreshListener

      com.vaadin.flow.shared.Registration addAfterRefreshListener(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.AfterRefreshEvent<T>> listener)
      Adds after refresh listener. It is invoked when data is refreshed.
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener