Search result pages
No edit summary
No edit summary
Line 1: Line 1:
This article explains the paging functionality available for [[Seeking_the_database_with_OCLps]].
This article explains the paging functionality available for [[Seeking_the_database_with_OCLps]].


Using the multivariable seeker to search the database you can configure the seeker to return the number of search result pages if the search does not fit within the MaxFetch setting.
Using the multivariable seeker to search the database, you can configure the seeker to return the number of search result pages if the search does not fit within the MaxFetch setting.


To set this up the seeker logic looks for a set of known variable names to communicate the results in:
To set this up the seeker logic looks for a set of known variable names to communicate the results in:

Revision as of 07:57, 20 March 2023

This article explains the paging functionality available for Seeking_the_database_with_OCLps.

Using the multivariable seeker to search the database, you can configure the seeker to return the number of search result pages if the search does not fit within the MaxFetch setting.

To set this up the seeker logic looks for a set of known variable names to communicate the results in:

Variable name Type Use
vSeekerPage integer You set: If this variable is found in a seeker - it controls what the search shows , on what page it is - vSeekerResultCount/vSeekerPageLength
vSeekerPageLength int64 You set: The number of items you want on a page
vSeekerPageCount integer Logic sets: The number of pages is set by the search logic for you to use, add variable and use type integer
vSeekerResultCount integer Logic sets: Total number of results by the search. The count of the sql query is set by search logic

See also MaxFetch. MaxFetch controls the maximum number of records returned. MaxFetch doesn't need the above variables to work, Note that MaxFetch is a tagged value

The Autoforms construct seeker that makes use of paging - refer to an autoform generated seeker to see details.

Currently, this is available in the WPF-client and Angular-Turnkey-client (new 2020-Aug).

For letting the framework know which grid on the page handles your search result, you must also add the tagged value IsSeekerResultGrid=true on the Nesting of your grid - again this is done by the AutoForms seekers.

Same explained in other words

When paging is turned on (define the variables above to turn it on) we will first execute the query with "select count(*) ...." to get the total count of hits in the db - this value is assigned to variable vSeekerResultCount.

You should set a desired page length - or expose this to your end users in the variable vSeekerPageLength.

The total number of pages available after search is then vSeekerPageCount:=vSeekerResultCount/vSeekerPageLength

If there a X pages available you control what page is actually fetched from db by setting a value in vSeekerPage between 1 and X prior to search.

Even if the UI is not generated today - you can easily add "next" and "prev" buttons that change vSeekerPage by +/- one and do selfVM.Search. UI is now generated in both WPF and Angular.

a.k.a Seekmore, seek more

This page was edited 96 days ago on 02/10/2024. What links here