Defining Smart Controls |
|
Creating Smart Controls consists of two main components: a Query List definition and a Smart Control (or a Smart Chart) definition. Furthermore, creating Smart Charts requires one additional component, a Query AutoChart definition, before the Smart Chart definition can be created.
|
1. |
To specify the details and format of the dataset to be loaded | |
|
2. |
(For Smart Charts Only) To define a NOMADS AutoChart based on the columns of a Query List definition | |
|
3. |
To associate the query and to set up optional Trigger Variables, Conditional Trigger Test and Load Logic |
Smart Controls use a Query object definition to determine the content of the Smart Control in terms of file selection, column definition and selection criteria. A Query List object consists of a query-like definition that is used exclusively by Smart Controls to auto-load a list of records from a data file or database table. This type of definition is a subset of the Standard Query with header information containing the file and key information only and the column definitions having limited options.
You can also use a Standard Query definition for Smart Controls (with the exception of the Smart Multi-Line); however, the control will only use this same subset of information and ignores the information in the other fields.
See Query Header for information on Standard Query header options.
To create a Query List Definition: | ||||||||||||||||||||||||||||
|
1. |
In NOMADS Library Object Selection, click the Query toolbar button (if using Toolbar View) or select Objects > Query Object from the menu bar. | ||||||||||||||||||||||||||
|
2. |
Type a new Name for the Query List definition. When prompted for Query Type, select Query List. Click OK, which brings up the Query Definition - File information window for defining the Query List header information. | ||||||||||||||||||||||||||
|
Alternatively, a new Query List can be defined in the Smart Control Definition window. To do this, type a new Panel name for the Query List definition. Click the Define button, which brings up the Query Definition - File information window for defining the Query List header information.
| |||||||||||||||||||||||||||
|
3. |
The Query Definition - File information window consists of the following options:
| ||||||||||||||||||||||||||
|
4. |
When you have finished entering the Query List header information, click OK, which brings up the Query List Definition window for defining the Query List contents.
This window is identical to the Query Definition window that is used to define a Standard Query where you can set up link files, define columns, edit file information and set up selection parameters. Query Security can also be set up for the Query List. However, the query selection criteria for a Query List definition (using the Filter toolbar button) is slightly different from the Query Selection Criteria for a Standard Query. The names and values of the trigger variables are available to the Query Load logic; therefore, these variables may be used to define Prefix and Range values as opposed to the Load logic of a Standard Query that uses global variables for these values. In addition, the Prefix and Range values can be applied to the Sort By key rather than just the primary key. The trigger variables are also available in an identical set of variables with a _VAR. prefix, which allows you to build selection tests that compare the external trigger variables with the _VAR. prefix to variables in the Query definition with the same name, e.g. _VAR.GLAcct$=GLAcct$. The Choose initial sort column option is available for Smart Report View List Boxes and Grids. However, unlike a query where the sort column is implemented only on the initial load, with Smart Controls, the sort column is implemented each time the control is reloaded. (The use of _VAR. aliases for variables passed to the *winlist logic was added in PxPlus 2021.) | ||||||||||||||||||||||||||
|
5. |
When you have finished entering this information, click the Save toolbar button to save the current Query List definition. |
Create a NOMADS AutoChart based on the columns in a Query List definition:
|
1. |
In NOMADS Library Object Selection, select the existing Query List object that will be used for creating the AutoChart. | |
|
2. |
The Query List Definition window displays. Click the Define Chart toolbar button. | |
|
3. |
The Welcome panel of the Chart Wizard displays. The Chart Wizard walks you through the steps for creating and saving an AutoChart.
|
The Smart Control Definition window is used to turn on the Smart Load logic and assign a Query to the target control (List Box, Drop Box, Grid, Multi-Line or Chart) to supply the list content and formatting information. It also allows you to optionally define load-triggering criteria (trigger variables and loading conditions) for the control, as well as specify Pre- and Post-Load logic as desired.
To invoke the Smart Control Definition window: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
1. |
In the NOMADS Panel Designer, access the Properties window for the target List Box, Drop Box, Grid, Multi-Line or Chart control. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
2. |
Locate the Smart Load button: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
3. |
Click the Smart Load button:
• When defining Smart Charts, the Smart Chart Definition window is displayed, which includes additional Chart Selection options.
Note: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4. |
The Smart Control Definition window consists of the following options:
|
| (For Charts Only - Available when Use Smart Load logic check box is selected)
(Chart Selection was added in PxPlus 2019.)
|
| Trigger variables serve two purposes:
The following options are available when a query is assigned for the Query Selection:
|
Conditional Trigger Test
| (Not Applicable for Smart Multi-Lines) Additional test to be imposed on load-triggering criteria. If defined, the Conditional Trigger Test must be satisfied for the Load logic to be triggered.
|
Text to Display if Read Fails
| (For Smart Multi-Lines Only - Available when Query Selection is entered) Text to load into the Multi-Line when the query fails to retrieve data. Can be a Fixed value, string Expression or Message Library entry (see Message Library Maintenance). If left blank, spaces will be loaded.
|
|
|
Load Logic
|
|
Formatting Smart Controls
Creating a Smart File