ui.Dialog.createInputArrayFrom
Creates an ui.Dialog
object to implement a dynamic
INPUT ARRAY FROM
.
Syntax
ui.Dialog.createInputArrayFrom(
fields DYNAMIC ARRAY OF RECORD
name STRING,
type STRING
END RECORD,
screenRecord STRING )
RETURNS ui.Dialog
- fields is the list of form fields controlled by the dialog.
This must be a
DYNAMIC ARRAY
of aRECORD
structure, with aname
andtype
member of typeSTRING
. - screenRecord is the name of the screen array (defined with
the
SCREEN RECORD
instruction in form files). - The method returns a new
ui.Dialog
object.
Usage
The ui.Dialog.createInputArrayFrom()
class method creates a dialog object to
implement the equivalent of a static INPUT ARRAY
FROM
block.
The current form will be attached to the created dialog.
The method takes a list of field definitions as parameter, as described in Field definition for Dynamic Dialogs.
A dynamic input array dialog behaves like a static INPUT ARRAY
using the
WITHOUT DEFAULTS
option: The values set in the internal rows before starting the
dialog will be used. However, like with a static INPUT ARRAY
, when adding a new
row, the DEFAULT
attributes of the form-fields are used.
The second parameter passed to the createInputArrayFrom()
method is
the name of the screen record which groups the fields together, for the list view of the form.
sr_custlist
":...
INSTRUCTIONS
SCREEN RECORD sr_custlist
(
customer.cust_id,
customer.cust_name,
...
);
END
For more details, see Screen records / arrays.
A dynamic dialog can be configured with the setDialogAttribute()
method.
Example
DEFINE fields DYNAMIC ARRAY OF RECORD
name STRING,
type STRING
END RECORD
DEFINE d ui.Dialog
...
LET d = ui.Dialog.createInputArrayFrom(fields, "sr_custlist")
...