In grids based on attributes, K2BTools uses the “Grid.PageCount” function in order to display the total number of pages the grid has. However, there are some scenarios where this function cannot be calculated or in which performing the operation can impact system performance.
In this page we are going to analize how to solve problems related with the use of the PageCount function.
By default, when using K2BTools, all grids based on attributes display the total number of pages. This is achieved using the Grid.PageCount function. Since the resolution of GeneXus SAC #47356, GeneXus can calculate Grid.PageCount even when conditions are evaluated on the client side. Starting from K2BTools 15.3, K2BTools added support for this feature, allowing page count calculation in these scenarios. However, this may impact performance, so the "DisplayPageCount" property can be disabled if needed.
-
In the navigation view, there is a constraint with a warning.
-
The term "server paging" does not appear as an optimization in the navigation.
 |
Warning in Navigation |
At runtime, the following issues may occur:
- Performance Degradation: The performance could be negatively impacted.
- Page Navigation Issues: In versions lower than K2BTools 15.3, the "next page" functionality may not work.
- Incorrect Page Count Display: In K2BTools versions lower than 10.4, a “-1” value may appear when displaying the total number of pages.
Our first recommendation is to try to change the condition that is calculated in the client side, so that it’s calculated in the server side. If you have any doubts on how to do this, we strongly recommend to contact GeneXus Support Team
If it is not possible to calculate the condition on the server side, the other solution is to set the “Display Page Count” property to "False". In that case, the total number of pages will not be shown, but the user will be able to navigate through the pages of the grid.
 |
Paging with "DisplayPageCount" set to "False" |
By default the “Display Page Count” property is set to true in all grids of the application. The default value can be changed in:
- For “Web Panel Designer” objects in Web Panel Designer settings' property “DisplayPageCount”.
- For “EntityServices” pattern generated objects, in EntityServices settings, in “Grid” -> “”WorkWithGrid” and “Grid” -> “SubWorkWith” in “DisplayPageCount” property, for “WorkWiths” and “SubWorkWiths”
- For “Prompt” pattern generated objects, in K2BPrompt settings, “Grid” -> “PromptGrid” , “DisplayPageCount” property.
|