Issues with Pagination Bar

WorkWithPlus adds a "Pagination Bar" within the grids in order to navigate the records:

An "Invoice" Work With web panel grid displays columns Id, Invoice Date, Country Name, Customer Name, Branch Name, Branch Geolocation, and Importe across 2,136 pages, with toolbar buttons Insert, Excel, PDF, Select columns, and Cargar, plus a filter for Importe values less than a given number.

In some situations the "Pagination Bar" may only show one page even if you have more records in your database:

The same "Invoice" Work With web panel grid now shows Page 1 of 1 with only nine records visible, and Importe column values including a negative -8072; a red arrow points to the pagination control on the bottom right, highlighting the single page indicator after filtering.

This issue happens because GeneXus can't properly calculate the Grid.PageCount value so it returns the value "1". As WorkWithPlus uses the Grid.PageCount to generate the "Pagination Bar" it only shows one page.

Important: GeneXus has solved many of the scenarios that cause these issues in GeneXus 16 Upgrade 9. We strongly recommend upgrading to GeneXus 16 U9 in order to avoid this problem.

If you can't upgrade your GeneXus version, the following tips will provide a workaround, to solve the issue in a Selection with base transaction. However, our recommendation is to upgrade to GeneXus 16 U9, to avoid having this issues.

Issue when having a Formula attribute

If you have a formula attribute in your transaction definition, the "Pagination Bar" may only show one page.

How to solve it?

In order to solve the issue, you can set the formula attribute as "Redundant":

The GeneXus Transaction structure editor lists the Invoice transaction's attributes (InvoiceId, CountryId, CountryName, CustomerId, CustomerName, BranchId, BranchName, BranchGeolocation, InvoiceTotal, InvoiceDate) and a nested Products level (ProductId, ProductName, ProductPrice, ProductVolume, InvoiceProductsQuantity, InvoiceProductsSubTotal), with columns for Type, Description, Redundant, Formula, and Nullable. A red arrow points to the InvoiceTotal row, which is marked Redundant with formula GetSum(InvoiceId).

Comment: this issue won't happen with every formula. It happens, for example, when GeneXus can't resolve the formula directly on the DBMS. A classic situation happens with formulas that call procedures. 

You can check the following GeneXus SAC regarding this issue: https://www.genexus.com/es/developers/websac?data=42532;;

Issue when having a condition

If you have included a condition you may have this issue according to where you load the variable included in it. For example, if you want to retrieve the CustomerId from the session and filter the records matching that Customer:

The GeneXus code editor for object "InvoiceWW" shows the Conditions tab with a WorkWithPlus-generated comment block ("Generated by DVelop Work With Plus Pattern <a href='Start'>Start</a>/<a href='End'>End</a> - Do not change") and, below it highlighted in a red box, a manually added condition line "CustomerId = &CustomerId;".

If you assign the variable &CustomerId at the end of the Refresh Event:

GeneXus generated grid event code sets BranchGeolocation and InvoiceTotal title formats and assigns &GridCurrentPage/&GridPageCount from the Grid object, ending the WorkWithPlus-generated block; below it, highlighted in a red box, a manually added line reads "&CustomerId = &WWPContext.CustomerId".

The "Pagination Bar" will display the following:

The "Invoice" Work With web panel grid displays IBM/Brasil/Branch 1 records with Importe 123000 repeated across multiple Ids, while below the grid a red-boxed "No records found." message appears despite the visible rows, illustrating a grid/filter inconsistency bug.

How to solve it?

In order to solve the issue, you can assign the variable at the top of the Refresh Event so it's considered in the calculation of the Grid.PageCount:

GeneXus source code editor showing the Event Refresh section of a Web Panel, with a red arrow highlighting the lines LoadWWPContext.Call(&WWPContext) and &CustomerId = &WWPContext.CustomerId, placed above the auto-generated WorkWithPlus filter variable initializations.

Other causes:

This issue may happen in other scenarios, for example:

  • when your grid contains attributes from a Data View
  • when having a date attribute in the Full Text Filter (just remove the attribute from the property Full Text Filter node --> Attributes)
  • when having a KB with "Runtime Translation" and an enum attribute in your Full Text Filter (just remove the attribute from the property Full Text Filter node --> Attributes)

In these scenarios, we strongly recommend upgrading to GeneXus 16 U9 in order to avoid this problem, as there is not a quick workaround to solve it.