Package io.jmix.ui.component
Interface PaginationComponent
- All Superinterfaces:
Component
,Component.BelongToFrame
- All Known Subinterfaces:
Pagination
,SimplePagination
- All Known Implementing Classes:
AbstractPagination
,PaginationImpl
,SimplePaginationImpl
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.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionAdds after refresh listener.Adds before refresh listener.boolean
boolean
void
setDataBinder
(PaginationDataBinder dataBinder) Sets a data binder.void
setItemsPerPageDefaultValue
(Integer defaultValue) Sets default value for the items per page ComboBox.void
setItemsPerPageOptions
(List<Integer> options) Sets items per page options which should be used in the ComboBox.void
setItemsPerPageUnlimitedOptionVisible
(boolean unlimitedOptionVisible) Sets visibility of unlimited (null) option value in the items per page ComboBox.void
setItemsPerPageVisible
(boolean itemsPerPageVisible) Sets visibility of items per page ComboBox.void
setTotalCountDelegate
(Supplier<Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
-
Method Details
-
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() { return dataManager.loadValue("select count(e) from demo_User e", Integer.class).one(); }
-
getDataBinder
- Returns:
- a data binder
-
setDataBinder
Sets a data binder. It is used for managing data loading and dividing data to pages. -
addBeforeRefreshListener
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
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
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 useUiComponentProperties.getPaginationItemsPerPageOptions()
. The default value isfalse
. -
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 withUiProperties.getEntityMaxFetchSize(String)
limitation. The default value istrue
. -
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
- 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.
-