ui.Dialog.createInputByName

Creates a new ui.Dialog object to handle an INPUT BY NAME.

Syntax

ui.Dialog.createInputByName(
   fields DYNAMIC ARRAY OF RECORD
                        name STRING,
                        type STRING
                    END RECORD
   )
  1. fields is the list of form fields controlled by the dialog. This must be a DYNAMIC ARRAY of a RECORD structure, with a name and type member of type STRING.

Usage

The ui.Dialog.createInputByName() class method creates a new dialog object to implement the equivalent of a static INPUT BY NAME block.
Note: The current form will be attached to the new created dialog.
The method takes a list of field definitions as parameter. The parameter must be defined as a DYNAMIC ARRAY OF RECORD, with name and type members:
DEFINE fields DYNAMIC ARRAY OF RECORD
                        name STRING,
                        type STRING
              END RECORD
These names provided in the field definition list must identify form fields defined in the current form. For example, if the current form file defines the following fields:
LAYOUT
...
END
TABLES
customer
END
ATTRIBUTES
EDIT f1 = customer.cust_id;
EDIT f2 = customer.cust_name;
...
END
The field names provided to the createInputByName() method must be defined as follows:
LET fields[1].name = "customer.cust_id"
LET fields[2].name = "customer.cust_name"
...

The types provided in the field definition list will identify the data type to be used for data input and display.

Possible values for types are the string equivalents of the Genero BDL built-in types, for example:
  • "INTEGER"
  • "VARCHAR(50)"
  • "DATE"
  • "DECIMAL(10,2)"
  • "DATETIME YEAR TO FRACTION(5)"
Note: The type used to define form fields can be the returning value of a base.SqlHandle.getResultType() method.

Example

DEFINE fields DYNAMIC ARRAY OF RECORD
                        name STRING,
                        type STRING
              END RECORD
DEFINE d ui.Dialog

OPEN FORM f1 FROM "custform"
DISPLAY FORM f1

LET fields[1].name = "customer.cust_id"
LET fields[1].type = "INTEGER"

LET fields[2].name = "customer.cust_name"
LET fields[2].type = "VARCHAR(50)"
...
LET d = ui.Dialog.createInputByName(fields)
...