A ConsoleForm part is primarily a set of console fields. As such,
it is a type of Record part. It is also a main part, which means the
following considerations apply:
- You can only specify one ConsoleForm per file.
- The ConsoleForm must be the only main part in the file.
- The file name must be the same as the ConsoleForm name and is
case sensitive.
The ConsoleForm is a Record part with the ConsoleForm stereotype
and can include not only console fields, but any of the fields that
are valid in any EGL record.
To make a console form active, you invoke the
consoleLib.displayForm() system
function. To display a read-only console form, for example, you can
do as follows:
- Call the consoleLib.displayForm() system
function
- Call the consoleLib.getKey() system
function to wait for a user keystroke
To allow the user to write to a console field, perform the following
actions instead:
- Call the consoleLib.displayForm() system
function
- Issue an openUI statement that references
either the displayed console form or specific console fields in the
console form.
To allow for user interaction with a displayed table of console
fields, perform the following actions:
- In the ConsoleForm part, declare an arrayDictionary that in turn
references console field arrays that are also declared in the ConsoleForm.
- Use that arrayDictionary in an openUI statement
To allow for user interaction with only a subset of console fields
in the console form, you can list the console fields in the openUI statement,
either explicitly or by referencing a dictionary. Like the arrayDictionary,
the dictionary is declared in the ConsoleForm and references console
fields that are also declared in the ConsoleForm.
EGL does not display any primitive variables that you declare in
the ConsoleForm. Use such variables to bind console fields, or you
can use primitive variables that you declare outside of the ConsoleForm.
You typically create console form bindings in either of two ways:
- By setting a default binding when you declare the console form.
- By setting a binding when you code the openUI statement.
Any binding specified in the openUI statement
overrides the default binding in total; none of the console form declaration
bindings remain.
If you use the
openUI statement to bind
variables, one option is to use the
isConstruct statement
property, which performs the following actions:
- Formats user input into a string appropriate to an SQL WHERE clause
- Places that string into a single variable so you can easily code
an SQL SELECT statement that retrieves the data that the user requests
from a relational database, as when you code an EGL prepare statement
For more information about the isConstruct property,
see openUI.
Tab order is the order in which the user tabs from one console
field to another. By default, the tab order is the order of the console
fields in the console form declaration. If you provide a list of console
fields in an openUI statement, the tab order
is the order of console fields in that statement; similarly, if you
provide a dictionary or arrayDictionary in an openUI statement,
the tab order is the order of console fields in the declaration of
the Dictionary or ArrayDictionary.
By default, the user exits a console form-related openUI statement
by pressing the Esc key.