Search result pages
(Created page with "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 s...")
 
No edit summary
 
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
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.
<message>Write the content here to display this box</message>
This article explains the paging functionality available for [[Training:Seeker view|seeking_the_database_with_OCLps]].


To set this up the seeker logic looks for a set of known variable names to communicate the results in:
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 [[Documentation:MaxFetch|MaxFetch]] setting.


/// If this variable is found in a seeker - it controls what the search shows , on what page it is - vSeekerResultCount/vSeekerPageLength
To set this up, the seeker logic looks for a set of known variable names to communicate the results in:


vSeekerPage
{| class="wikitable"
!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'' 
|Integer
|'''''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'' 
|Int64
|'''''Logic sets:''' Total number of results by the search. The count of the SQL query is set by search logic''
|-
|
|
|<code>'''<span class="col-black">IsSeekerResultGrid=true</span>'''</code> on the Nesting of your grid to know where paging buttons should go
|}
'''See also:''' [[Documentation:MaxFetch|MaxFetch]]. MaxFetch controls the maximum number of records returned. '''The default - if not using MaxFetch - is 20 records.''' MaxFetch doesn't need the above variables to work. Note that MaxFetch is a ''tagged value''.


/// The number of pages is set by the search logic for you to use, add variable and use type integer
The Autoforms construct seeker that makes use of paging refers to an Autoform-generated seeker to see details.


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


/// The number of items you want on a page
To let the Framework know which grid on the page handles your search result, you must also add the tagged value <code>'''<span class="col-black">IsSeekerResultGrid=true</span>'''</code> on the Nesting of your grid - again this is done by the AutoForms seekers.


vSeekerPageLength
==== Same Explained in Other Words  ====
When paging is turned on (define the variables above to turn it on), you will first execute the query with "select count(*) ...." to get the total count of hits in the DB - this value is assigned to the variable <code><span class="col-black">vSeekerResultCount</span></code>.


/// The count of the sql query is set by search logic - you must add a variable of this name of type longint
You should set a desired page length - or expose this to your end users in the variable <code><span class="col-black">vSeekerPageLength</span></code>.


vSeekerResultCount
The total number of pages available after the search is then <code><span class="col-black">vSeekerPageCount:=vSeekerResultCount/vSeekerPageLength</span></code>


The Autoforms construct seeker that make use of paging - refer to an autoform generated seeker to see details.
If there are X pages available, you control what page is actually fetched from the DB by setting a value in vSeekerPage between 1 and X prior to the search.  


Currently this is only available in the WPF-client. TODO - Implement in Turnkey Views
UI is now generated in both WPF and Angular.  
 
a.k.a Seekmore, seek more
[[Category:Searching]]
{{Edited|July|12|2025}}

Latest revision as of 05:28, 31 January 2025

This page was created by Hans.karlsen@mdriven.net on 2020-01-23. Last edited by Stephanie@mdriven.net on 2025-01-31.

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 Integer 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 Int64 Logic sets: Total number of results by the search. The count of the SQL query is set by search logic
IsSeekerResultGrid=true on the Nesting of your grid to know where paging buttons should go

See also: MaxFetch. MaxFetch controls the maximum number of records returned. The default - if not using MaxFetch - is 20 records. 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 refers to an Autoform-generated seeker to see details.

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

To let 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), you will first execute the query with "select count(*) ...." to get the total count of hits in the DB - this value is assigned to the 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 the search is then vSeekerPageCount:=vSeekerResultCount/vSeekerPageLength

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

UI is now generated in both WPF and Angular.

a.k.a Seekmore, seek more