Legacy platform

Customizing pagination size

When a user searches for orders, customers, products, the search results are distributed across pages. Using pagination, the user can go to the appropriate page that contains the information. You can extend the page size and page size array as needed for your business. The application provides the default page size and page size array such as 5, 10, 20, and 40. The user can select the appropriate page size to display records.

Procedure

  1. By default, the PaginationSize.json file is present in the <INSTALL_DIR>/repository/eardata/isccs/war/isccs/common/pagination directory. In run time, copy the PaginationSize.json file to the extensions/isccs/webpages/isccs/common/pagination/ directory. Build the WAR or EAR and deploy it to verify the changes. Modify the page size attribute appropriately as shown in the following sample code:
    {
    	Entities: {
    		"Order": {
    			"PageSize": 10,
    			"PageSizes": "5,10,20,40"
    		},
    		"Default":{
    			"PageSize": 10,
    			"PageSizes": "5,10,20,40"
    		}
    	}
    }
  2. The PaginationSize.json file contains different entities such as order, customer, product. For each entity, the PageSize and PageSizes attributes represent the default page size and page size array. You can modify these attributes appropriately. The page size and page size array of the entity that you modify must be same as the last element in the path attribute of BindingData/SourceBinding property in the pagination grid. Consider that you want to modify the page size attribute present in the OrderList grid. Identify the path attribute present in the BindingData/SourceBinding property, which is Order entity. Search for the Order entity in the PaginationSize.json file and modify the PageSize and PageSizes attributes.
  3. If you want to customize the PageSize attribute for a particular paginated grid, in the BindingData/PaginationBinding property, modify the pageSizePackage, pageSizeClassName, and pageSizeFunc attributes.
    • The pageSizePackage or pageSizesPackage attributes refer to the package where the implementation function is present.
    • The pageSizeClassName or pageSizesClassName attributes refer to the class name.
    • The pageSizeFunc or pageSizesFunc attributes refer to the method name. The arguments that are passed to this method are path, screen, uID of the grid, and model object. A sample implementation of pageSizeFunc attribute is as follows:
      uiUtils.getPageSize = function (path,screen,gridID,model) {
      						return "20";
      					};
    Note: You cannot extend the Content Pane in which the page numbers are displayed in the Product Browsing screen.
    For all screens that support pagination, the following three attributes are provided in the Init Mashups. The application provided values cannot be edited. However these attributes can be edited for custom Init Mashups.
    • paginationStrategy: This attribute signifies the pagination strategy which must be used for pagination. Currently, only "NEXTPAGE" pagination strategy is supported.
    • pageSize: This is the pageSize which is defaulted. Page size denotes the number of records in each page.
    • pageSizeType: This attribute can take any text as a value. This attribute can be used to specify some string values which can be used in custom mashup class as required.