Package io.jmix.flowui.component
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.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
The event that is fired after data refresh.static class
The event that is fired before refreshing the data, when the user clicks next, previous, etc. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addAfterRefreshListener
(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.AfterRefreshEvent<T>> listener) Adds after refresh listener.com.vaadin.flow.shared.Registration
addBeforeRefreshListener
(com.vaadin.flow.component.ComponentEventListener<PaginationComponent.BeforeRefreshEvent<T>> listener) Adds before refresh listener.void
Sets loader to the component.void
setTotalCountDelegate
(Function<LoadContext, Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.
-
Method Details
-
getPaginationLoader
- Returns:
- pagination data loader or
null
if not set
-
setPaginationLoader
Sets loader to the component.- Parameters:
loader
- pagination data loader to set
-
getTotalCountDelegate
- Returns:
- delegate which is used to get the total count of items
-
setTotalCountDelegate
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
-