9. Generating Fields from Predefined Templates : How You Can Add a Generated Field to a Frame : The query_bar Field Template : How a Query Bar Works
 
Share this page                  
How a Query Bar Works
When the frame containing the query bar is executed, it appears as follows:
Browsing Records
The browse bar consists of four VCR‑style buttons for moving to the first, previous, next, or last record of the result set. When the user clicks a button, the browse bar notifies the query control, which then moves to the proper record and displays it.
Sorting Records
The sort bar lets the user reorder the records in the result set. It contains an option field that lists all columns in the QueryObject, from which the user can choose a column to sort (initially, the order is Default).
After the user selects a column, the adjacent option field is used to select ascending (Up) or descending (Down) order. If you defined a default sort order when building your query object, the OrderBy column you specified is added to the user's selection as a secondary sort field. Only the first OrderBy column in the query object is used.
The new sort order is not applied until the user clicks the Go button, so the user can also change selection criteria before retrieving the new results.
Selecting Criteria
The criteria bar lets the user apply additional selection criteria to a result set. It contains an option field that lists all columns in the QueryObject and lets the user select a column to filter (by default, the selection is All Records).
After the user has selected a column, a second option field—populated with the list of available comparison operators for that data type—is used. The user can select a comparison operator from the list, and then enter a comparison value into an adjacent entry field. For example, a user might enter "cacctbal > 25" to restrict the query to customers whose account balance is greater than $25.00.
The selection criteria are not applied until the user clicks Go. Any sort order changes the user makes are also applied at that point. Any criteria you defined when creating the query object are added to the user's specification so that the original result set cannot be extended.