Summary:
See also: Form Specification Files.
Attribute | Description |
ACCELERATOR | First accelerator key for an action default |
ACCELERATOR2 | Second accelerator key for an action default |
ACCELERATOR3 | Third accelerator key for an action default |
ACCELERATOR4 | Fourth accelerator key for an action default |
ACTION | Action name to be sent to the program when the item is activated |
AGGREGATETEXT | Label to be displayed for the aggregate cell |
AGGREGATETYPE | Type of computation of the aggregate field |
AUTOSCALE | Forces the item's contents to be scaled according to the available space |
AUTONEXT | Automatically gives the focus to the next field when all data is entered |
BUTTONTEXTHIDDEN | Indicates that the button labels of the element must be hidden |
CENTURY | Specifies expansion of 2-digit years in DATE and DATETIME fields |
COLOR | Specifies the foreground color of the text displayed by a form item |
COLOR WHERE | Defines a Boolean condition based on field values to set the color attribute dynamically |
CONTEXTMENU | Defines if the context menu option must be displayed for an action |
COMMENT | Specifies a message to display on the Comment line |
COMPONENTTYPE | Defines the type of the Web Component |
DEFAULT | Assigns a default value to a field during data entry |
DEFAULTVIEW | Defines if the default view must be displayed for an action |
DISPLAY LIKE | Assigns attributes from the database schema files |
DOUBLECLICK | Defines the action to be sent when user double-clicks on the item |
DOWNSHIFT | Converts to lowercase any uppercase character data |
EXPANDEDCOLUMN | Indicates the form field that specifies whether a tree node is expanded (opened) |
HEIGHT | Explicitly defines the height of a form element |
HIDDEN | Makes an element invisible |
FONTPITCH | Defines the character font type as fixed or variable |
FORMAT | Formats DECIMAL, MONEY, SMALLFLOAT, FLOAT, or DATE field formatting |
GRIDCHILDRENINPARENT | Aligns children to the parent container |
IDCOLUMN | Specifies the form field containing the identifier of a tree node |
IMAGE | Defines the URL of the image resource associated to the form item |
IMAGECOLUMN | Defines the field that holds the image for this field |
IMAGECOLLAPSED | Specifies the icon to be used when a tree node is collapsed |
IMAGEEXPANDED | Specifies the icon to be used when a tree node is expanded |
IMAGELEAF | Specifies the icon to be used for leaf nodes in a tree |
INCLUDE | Lists a set of acceptable values during data entry |
INITIALIZER | Specifies an initialization function for the ComboBox item |
INVISIBLE | Does not echo characters on the screen during data entry |
ISNODECOLUMN | Specifies the form field that indicates a tree node has children |
ITEMS | Defines a list of values to be used by the form item |
JUSTIFY | Specifies the justification of the content of a field |
MINHEIGHT | Defines a minimum height for the form item |
MINWIDTH | Defines a minimum width for the form item |
NOT NULL | Indicates that the field does not accept NULL values |
NOENTRY | Prevents the user from entering data in the field |
ORIENTATION | Defines the orientation of an element as vertical or horizontal |
PARENTIDCOLUMN | Specifies the form field containing the identifier of a tree node's parent |
PICTURE | Imposes a data-entry format on CHAR or VARCHAR fields |
PROGRAM | Invokes an external program to display TEXT or BYTE values |
PROPERTIES | Defines a free list of widget-specific properties |
QUERYEDITABLE | Allows a combobox field to be editable during a CONSTRUCT |
REQUIRED | Requires the user to supply a value during input instructions |
REVERSE | Causes values in the field to be displayed in reverse video |
SAMPLE | Provides the text to be used as a sample to compute the width |
SCROLL | Allows scrolling within the field |
SCROLLBARS | Defines vertical and/or horizontal scrollbars for the form item |
SIZEPOLICY | Indicates sizing hint to display form elements. |
SPACING | Indicates spacing hint to display form elements |
SPLITTER | Indicates that the container must use a splitter |
STEP | Defines how much the value increases or decreases with a single click |
STRETCH | Defines how the widget must resize according to the parent container |
STYLE | Defines a presentation style for the form element |
TAG | Defines a string identifier for the form item |
TABINDEX | Defines the tab order for the form item |
TEXT | Defines the label to be associated with the form item |
TITLE | Defines the title to be associated with the form item |
UPSHIFT | Converts to uppercase any lowercase character data |
UNHIDABLE | Indicates that the column cannot be hidden |
UNHIDABLECOLUMNS | The table does not allow columns to be hidden |
UNMOVABLE | Indicates that the column cannot be moved |
UNMOVABLECOLUMNS | Prevents the user from changing the order of the columns |
UNSIZABLE | Indicates that the column cannot be resized |
UNSIZABLECOLUMNS | The table does not allow columns to be resized |
UNSORTABLE | Indicates that the column cannot be used for sorting |
UNSORTABLECOLUMNS | The table does not allow rows to be sorted |
VALIDATE | Defines the data validation mode for a given action |
VALIDATE LIKE | Validates data entry with definitions from the database schema files |
VALUEMIN | Defines the lower limit for widgets (such as progressbars) |
VALUEMAX | Defines the upper limit for widgets (such as progressbars) |
VALUECHECKED | Defines the value to be associated with a checked checkbox |
VALUEUNCHECKED | Defines the value to be associated with an unchecked checkbox |
VERIFY | Requires that data be entered twice when the database is modified |
VERSION | Defines a user version string for an element |
WANTTABS | Forces the field to consume TAB keys |
WANTNORETURNS | Forces the field to reject RETURN keys |
WANTFIXEDPAGESIZE | Forces the table to have a fixed height when the parent window is resized |
WIDTH | Explicitly defines the width of a form element |
Specifies the style to be used by the parent window | |
WORDWRAP | Invokes a multiple-line editor in multiple-segment fields |
Attributes supported for backward compatibility with Four Js BDS | |
CLASS | Specifies the behavior of a field defined with the WIDGET attribute |
CONFIG | Specifies the parameters for the definition of a widget (only used with WIDGET attribute) |
KEY | Defines the label of a key when the field gets the focus |
OPTIONS | Specifies widget definition options |
WIDGET | Defines the type of widget to be used for presentation |
The ACCELERATOR attribute defines the primary accelerator key of an action default item.
ACCELERATOR = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR2 attribute defines the secondary accelerator key of an action default item.
ACCELERATOR2 = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR3 attribute defines the third accelerator key of an action default item.
ACCELERATOR3 = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR4 attribute defines the fourth accelerator key of an action default item.
ACCELERATOR4 = [CONTROL-][SHIFT-][ALT-]key
The ACTION attribute defines the name of the action to be sent to the program when the user activates the form item.
ACTION = action-name
01
BUTTONEDIT f001 = customer.state, ACTION = print;
The AGGREGATETEXT attribute can be used to define the label to be displayed for aggregate fields.
AGGREGATETEXT = [%]"string"
01
AGGREGATE tot = FORMONLY.total, AGGREGATETEXT="Total:";
The AGGREGATETYPE attribute defines how the aggregate field value is computed.
AGGREGATETYPE = { PROGRAM | SUM | AVG | MIN |
MAX | COUNT }
An aggregate type different from PROGRAM specifies that the aggregate value is computed automatically:
The SUM and AVG aggregate types apply to data types that can be used as operand for an addition, such as INTEGER, DECIMAL, INTERVAL.
The MIN and MAX aggregate types apply to data types that can be compared, such as INTEGER, DECIMAL, INTERVAL, CHAR, DATETIME.
01
AGGREGATE tot = FORMONLY.total, AGGREGATETYPE=PROGRAM;
The AUTOSCALE attribute causes the form element contents to automatically scale to the size given to the item.
AUTOSCALE
The AUTONEXT attribute causes the cursor to automatically advance during input to the next field when the current field is full.
AUTONEXT
AUTONEXT is particularly useful with character fields in which the input data is of a standard length, such as numeric postal codes or the abbreviations in the state table. It is also useful if a character field has a length of 1 because only one keystroke is required to enter data and move to the next field.
The CENTURY attribute specifies how to expand abbreviated one- and two-digit year specifications in a DATE and DATETIME field. Expansion is based on this setting (and on the year value from the system clock at runtime).
CENTURY = { "R" | "C" |
"F" | "P" }
CENTURY supports the same settings as the DBCENTURY environment variable, but with a scope that is restricted to a single field.
If the CENTURY and DBCENTURY settings are different, CENTURY takes precedence.
Unlike DBCENTURY, the CENTURY attribute is not case sensitive. However, we recommend that you use uppercase letters in the attribute.
The CLASS attribute is used to define the behavior of a field.
CLASS = "identifier"
Class | Description |
KEY | Field is used to trigger a keystroke instead of being a
normal input field. Only supported with special widgets such as buttons, checkboxes and radiobuttons. |
PASSWORD | Field input is masked by replacing normal character echo by stars "*". |
This attribute is supported for backward compatibility with Four Js BDS, you should use new Genero form item types instead.
The COLOR attribute defines the foreground color of the text displayed by a form element.
COLOR = color-name
For backward compatibility, color-name can be combined with an intensity keyword: REVERSE, LEFT, BLINK, and UNDERLINE.
01
EDIT f001 = customer.name, COLOR = RED;
The COLOR WHERE attribute defines a condition to set the foreground color dynamically.
COLOR = color-name [...] WHERE boolexpr
The condition in COLOR WHERE can only reference the field for which the attribute is set. The Boolean expression is automatically evaluated at runtime to check when the color attribute must be set.
The COLOR WHERE attribute may not be supported in all situations; it is not supported in TABLE columns.
01
EDIT f001 = item.price, COLOR=RED WHERE f001>100;
The CONFIG attribute is used with the WIDGET attribute to define the behavior and decoration of the field.
CONFIG = "parameter [...]"
This attribute is supported for backward compatibility with Four Js BDS, you should use new Genero form item types instead.
Defines whether a context menu option must be displayed for an action.
CONTEXTMENU = [ AUTO | YES | NO ]
CONTEXTMENU is an Action Default attribute defining whether the context menu option must be displayed for an action.
The default is YES.
Note that this attribute applies to the actions defined by the current dialog in the current window.The COMMENT attribute defines text that can be shown when the element becomes current.
COMMENT = [%]"string"
The screen location where the message is displayed depends on external configuration. It can be displayed in the COMMENT LINE, or in the STATUSBAR when using a graphical user interface.
Note that if the OPEN WINDOW statement specifies COMMENT LINE OFF, any output to the comment area is hidden even if the window displays a form that includes fields that include the COMMENT attribute.
01
EDIT f001 = customer.name, COMMENT = "The customer name";
The COMPONENTTYPE attribute defines a name identifying the external widget.
COMPONENTTYPE = "name"
The COMPONENTTYPE attribute is used to define the type of a WEBCOMPONENT form item.
The value of this attribute will be mapped to a specific widget definition on the front-end side. See front-end specific documentation related to Web Components.
01
WEBCOMPONENT f001 = FORMONLY.mycal, COMPONENTTYPE="Calendar";
The DEFAULT attribute assigns a default value to a field during data entry.
DEFAULT = value
The effect of the DEFAULT attribute depends on the WITHOUT DEFAULTS configuration option of the dialog using the form:
With the INPUT statement, form default values have are ignored when using the WITHOUT DEFAULTS option. With this option, the runtime system displays the values in the program variables to the screen. Otherwise, the form default values will be displayed when the dialog starts.
With the INPUT ARRAY statement, the form default values are always used for new rows inserted by the user. With INPUT ARRAY, the WITHOUT DEFAULTS option indicates if the existing program array elements have to be used.
Note that defaults values can also be specified in the Database Schema file, for form fields defined with database column reference.If the field is FORMONLY, you must also specify a data type when you assign the DEFAULT attribute to a field.
If both the DEFAULT attribute and the REQUIRED attribute are assigned to the same field, the REQUIRED attribute is ignored.
If you do not use the WITHOUT NULL INPUT option in the DATABASE section, all fields default to null values unless you have specified a DEFAULT attribute.
Note that DATETIME and INTERVAL literals are not supported.
01
EDIT f001 = order.orderdate, DEFAULT = TODAY;
Defines if a default view (i.e. button) must be displayed for a given action.
DEFAULTVIEW = [ AUTO | YES | NO ]
DEFAULTVIEW is an Action Default attribute defining whether the default action view (i.e. a button) must be displayed for an action.
The default is AUTO.
Note that this attribute applies to the actions defined by the current dialog in the current window.The DISPLAY LIKE attribute takes column attributes defined in the database schema files and applies them to a field.
DISPLAY LIKE [table.]column
Display attributes are automatically taken from the schema file if the field is linked to table.column in the field name specification.
Note that the DISPLAY LIKE clause is evaluated at compile time, not at runtime. If the database schema file changes, you might need to recompile a program that uses the LIKE clause. Even if all of the fields in the form are FORMONLY, this attribute requires the form compiler to access the database schema file that contains the description of table.
01
EDIT f001 = FORMONLY.fullname, DISPLAY LIKE customer.custname;
The HIDDEN attribute indicates that the element should not be displayed.
HIDDEN [ = USER ]
By default, all elements are visible. You can use the HIDDEN attribute to hide an element, such as a form field or a groupbox. The runtime system handles hidden form fields. If you write an INPUT statement using a hidden field, the field is ignored (as if it was declared as NOENTRY). Programs may change the visibility of form fields dynamically with the ui.Form built-in class.
When you use the HIDDEN keyword only, the underlying item attribute is set to 1. The value 1 indicates that the element is hidden to the user without the possibility of showing the element, for example with the context menu of table headers. In this hidden mode, the UNHIDABLE attribute is ignored by the front end.
When you use HIDDEN=USER, the underlying item attribute is set to 2. The value 2 indicates that the element is hidden by default, but the user can show/hide the element as needed. For example, the user can change a hidden column back to visible. Form elements like table columns that are hidden by the user might be automatically re-shown (hidden=0) by the front-end if the program dialog gives the focus to that field for input. In such case the program dialog takes precedence over the hidden attribute.
When you set a hidden attribute for a form field, the model node gets the hidden attribute, not the view node.Form fields hidden with the USER option (value 2) might be shown anyway if the field is needed by a dialog for input.
01
EDIT f001 = FORMONLY.field1, HIDDEN;02
EDIT col1 = FORMONLY.column1, HIDDEN=USER;
The HEIGHT attribute defines an explicit height for a form element.
HEIGHT = integer [CHARACTERS|LINES|POINTS|PIXELS]
By default, the size of an element is defined in characters and automatically computed by the form compiler according to the size of the form element in the layout.
For items like images, the default height is defined by the number of lines of the item tag (as a vertical character height). You can overwrite this default by specifying the HEIGHT attribute. You typically give a number of pixels.
For tables, the default height is defined by the number of lines used in the table layout. You can overwrite this default by specifying the HEIGHT attribute.
If you don't specify any unit, the size unit defaults to CHARACTERS, which defines the number of grid cells.
See also: WIDTH.
01
IMAGE img1 : image1, WIDTH = 200 PIXELS, HEIGHT = 120 PIXELS;
The BUTTONTEXTHIDDEN attribute indicates that the labels of the buttons of this element should not be displayed.
BUTTONTEXTHIDDEN
Use in a TOOLBAR definition to hide the labels of buttons.
The DOUBLECLICK attribute defines the action to be sent when the user double-clicks on a TABLE row.
DOUBLECLICK = action-name
This attribute is typically used in a TABLE container, to define the action to be sent when the user double-clicks on a row. By default, if the TABLE is driven by a DISPLAY ARRAY, a double-click invokes the accept action. When using an INPUT ARRAY, double-click selects the whole text if the current widget is editable. If DOUBLECLICK is defined when using an INPUT ARRAY, the action can only be sent when the user double-clicks on a non-editable widget like a LABEL.
The DOWNSHIFT attribute forces character input to lowercase letters.
DOWNSHIFT
Assign the DOWNSHIFT attribute to a character field when you want the runtime system to convert uppercase letters entered by the user to lowercase letters, both on the screen and in the corresponding program variable.
Because uppercase and lowercase letters have different values, storing character strings in one or the other format can simplify sorting and querying a database.Characters entered by the user are converted in INPUT, INPUT ARRAY and CONSTRUCT instructions.
The results of conversions between uppercase and lowercase letters are based on the locale settings (LANG). When using single byte runners, the conversion of ASCII characters >127 is controlled by the LC_CTYPE environment variable.
See also: UPSHIFT.
You can use the FORMAT attribute with numeric and date time fields to control the format of output displays.
FORMAT = "format-string"
Understand that the FORMAT attribute is applied when displaying program variable data to form fields. In order to control user input with a mask, you must use the PICTURE attribute instead. The PICTURE attribute is typically used to specify an input mask for formatted character string fields.
If format-string is smaller than the field width, you get a compile-time warning, but the form is usable.
For DECIMAL, MONEY, SMALLFLOAT, and FLOAT data types, format-string consists of a set of placeholders that represent digits, currency symbols, thousands and decimal separators. For example, "###.##@" defines three places to the left of the decimal point and exactly two to the right, plus a currency symbol at the end of the string.
When used with numeric values, the format-string must use normalized placeholders described in the table below. Some of these wildcard characters will be replaced by digits, blanks or by the elements defined in the DBMONEY or DBFORMAT environment variables.
Note that field input cannot be supported, if the format is not defined with normalized placeholders.
If the numeric value is too large to fit in the number of characters defined by the format, an overflow text is displayed (****).
If the actual number displayed requires fewer characters than format-string specifies, numbers are right-aligned and padded on the left with blanks.
If necessary to satisfy the format-string specification, the number values are rounded before display.
Character |
Description |
* | The star placeholder fills with asterisks any position that would otherwise be blank. |
& | The ampersand placeholder is used to define the position of a digit, and is replaced by a zero if that position would otherwise be blank. |
# | The sharp placeholder is used to define the position of a digit, it is used to specify a maximum width for the resulting string. This wildcard character does not change any blank positions in the display: The character is replaced by a blank if no digit is to be displayed at that position. |
< | Consecutive less than characters cause left alignment and define digit positions. |
- | Displays a minus sign or a blank at that position. USING displays a minus sign when the expression is lower than zero, and otherwise a blank character. When you group several minus signs in the format string, a single minus sign floats immediately to the left of the displayed number. |
+ | Displays a plus or minus sign at that position. USING displays a plus sign when the expression is greater than or equal to zero, and a minus sign the the value is less than zero. When you group several plus signs in the format string, a single plus sign floats immediately to the left of the displayed number. |
( | Displayed as left parenthesis for negative numbers. It is used to display accounting parentheses instead of a minus sign for negative numbers. Consecutive left parentheses display a single left parenthesis to the left of the number being printed. |
) | Displayed as right parenthesis for negative numbers. This wildcard character is used in conjunction with a open brace to display accounting parentheses for negative numbers. |
, | The comma placeholder is used to define the position for the thousand separator defined in DBFORMAT. The thousand separator will only be displayed if there is a number on the left of it. |
. | The period placeholder is used to define the position for the decimal separator defined in DBMONEY or DBFORMAT. You can only have one decimal separator in a number format string. |
$ | The dollar sign is the placeholder for the front currency symbol defined in DBMONEY or DBFORMAT. When you group several consecutive dollar signs, a single front currency symbol floats immediately to the left of the number being printed. The front currency symbol can be defined in DBFORMAT with more than one character. |
@ | The at sign is the placeholder for the back currency symbol defined in DBMONEY or DBFORMAT. Put several consecutive @ signs at the end of the format string to display a currency symbol defined in DBFORMAT with more than one character. |
The following table illustrates the results of different combinations of DBFORMAT setting and FORMAT attribute:
FORMAT attribute |
Numeric value | DBFORMAT | Result string |
---,--&.&& | -1234.56 | :.:,: | -1.234.56 |
$---,--&.&& | -1234.56 | E:.:,: | E -1.234,56 |
---,--&.&&@ | -1234.56 | :.:,:E | -1,234.56E |
When the user enters numeric or currency values in fields, the runtime system behaves as follows:
The next table shows the formatting symbols for DATE fields (does apply to DATETIME fields). Any other character is interpreted as a literal and will be displayed as is in the field:
Character |
Description |
dd | Day of the month as a 2-digit integer. |
ddd | Three-letter English-language abbreviation of the day of the week, for example, Mon, Tue. |
mm | Month as a 2-digit integer. |
mmm | Three-letter English-language abbreviation of the month, for example, Jan, Feb. |
yy | Year, as a 2-digits integer representing the 2 trailing digits. |
yyyy | Year as a 4-digit number. |
Below some format-string examples and their corresponding display formats for a DATE field:
FORMAT attribute |
Date value | DBDATE | Result string |
None (DBDATE applies) | 1999-09-23 | DMY4/ | 23/09/1999 |
dd-mm-yyyy | 1999-09-23 | DMY4/ | 23-09-1999 |
dd-mm-yy | 1999-09-23 | DMY4/ | 23-09-99 |
(ddd.) mmm. dd, yyyy | 1999-09-23 | DMY4/ | (Thu.) Sep. 23, 1999 |
01
EDIT f001 = order.thedate, FORMAT = "mm/dd/yyyy";
This attribute defines the character font type as fixed or variable when the default font is used.
FONTPITCH = {FIXED|VARIABLE}
By default, most front ends use variable width character fonts, but in some cases you might need to use a fixed font.
When usingFIXED
, you force the characters to
have a fixed size.
When using VARIABLE
, you allow the characters to
have a variable size.
It is recommended that you use a STYLE defining a fixed font instead of this attribute.
This attribute is used for a container to align its children to the parent container.
GRIDCHILDRENINPARENT
By default, child elements of a container are aligned locally inside the container layout cells. With this attribute, you can force children to be aligned according to the layout cells of the parent container of the container to which you assign this attribute.
This is useful, for example, when you want to align fields across groups defined with Layout Tags inside a GRID:
01
LAYOUT02
GRID03
{04
<G g1 >05
Field1 [f1 ]06
Field2 [f2 ]07
Field3 [f3 ]08
09
<G g2 >10
F4 [f4 ]11
F5 [f5 ]12
13
}14
END15
END16
ATTRIBUTES17
GROUP g1 : GRIDCHILDRENINPARENT;18
GROUP g2 : GRIDCHILDRENINPARENT;19
EDIT f1 = FORMONLY.field1;20
EDIT f2 = FORMONLY.field2;21
EDIT f3 = FORMONLY.field3;22
EDIT f4 = FORMONLY.field4;23
EDIT f5 = FORMONLY.field5;24
END
Defines a list of possible values.
INCLUDE = ( { NULL | literal [ TO literal
] } [,...] )
The INCLUDE attribute specifies acceptable values for a field and causes the runtime system to check the data before accepting an input value.
If the field is FORMONLY, you must also specify a data type when you assign the INCLUDE attribute to a field.
DATETIME and INTERVAL literals are not supported.
01
EDIT f001 = compute.rate, INCLUDE = ( 1 TO 100, 200, NULL);02
EDIT f002 = customer.state, INCLUDE = ( "AL" TO "GA", "IA" TO "WY" );
The INVISIBLE attribute prevents user-entered data from being echoed on the screen during an interactive statement.
INVISIBLE
Note that the INVISIBLE attribute does not prevent display instructions like DISPLAY, DISPLAY ARRAY from explicitly displaying data in the field.
The IMAGE attribute defines the image resource to be displayed in the form item.
IMAGE = "resource"
This attribute is used to define the image resource to be displayed form items such a button, buttonedit or a static image item.
The resource string can be one of the following:
It is recommended that you use simple image file names without the file extension, and define the FGLIMAGEPATH environment variable to centralize image files on the application server in a directory created specifically for images. For portability reasons, use .png or .svg image file formats only.
Here is the list of image file formats supported by the different front-ends:
Suffix (case insensitive) | Front-ends supporting the file format |
.BMP |
GDC, GWC |
.GIF |
GDC, GWC |
.ICO |
GDC, GWC |
.JPG |
GDC, GWC |
.PNG |
GDC, GWC |
.SVG |
GDC, GWC |
.TIFF |
GDC, GWC |
According to the front-end type, some image file formats or image data formats might not be supported.
If the image specification is a simple string without an URL or URI prefix, it is identified as a file path. The file is first sought in the picture directory on the client workstation. According to the front-end type, this local directory can actually be on a remote machine where the GAS middleware component is located. If the file is not found, the front-end automatically sends an image request to the runtime system, in order to search for an image on the server where the programs are executed. The runtime system searches for server-side images by using the FGLIMAGEPATH environment variable. If FGLIMAGEPATH is not set, the image files are searched in the current working directory.
Warning: By default, if FGLIMAGEPATH
is not set, the image files are searched in the current working directory.
Image file names can use absolute or relative paths and the whole
application server file system can be searched (according to the permissions
of the operating system user running the fglrun process).
This can be a security hole because fake front-ends could ask for critical
server files that are not images.
When setting FGLIMAGEPATH,
the runtime system will only transfer files found in the directories listed
in that environment variable. You can still use absolute or relative paths
in the image file names, but the files must be located below one of the
directories listed in FGLIMAGEPATH. For maximum security, put the image files in directories that
contain only image files, and keep critical data or program file in separate
directories.
Note however that images displayed by program to image
fields do not follow the FGLIMAGEPATH security restriction. Image field
do not use the IMAGE attribute: For fields, the image is specified
in the field value.
If the image specification starts with a URL prefix, the front-end will try to download the image from the location specified by the URL.
Currently supported URLs are:
Image resource location (URL) | Description |
http://location-specification |
HTTP server |
https://location-specification |
HTTPS server (HTTP over SSL) |
ftp://location-specification |
FTP server |
01
BUTTONEDIT f001 = FORMONLY.field01, IMAGE = "zoom";02
BUTTON b01 : open_file, IMAGE = "buttons/fileopen";03
BUTTON b02 : accept, IMAGE = "http://myserver/images/accept.png";
The KEY attribute is used to define the labels of keys when the field is made current.
KEY keyname = [%]"label"
This attribute is supported for backward compatibility with Four Js BDS.
See also the KEYS section to define key labels for the whole form.
01
EDIT f001 = customer.city, KEY F10 = "City list";02
EDIT f002 = customer.state, KEY "Control-z" = "Open Zoom";
The MINHEIGHT attribute defines the minimum height of a form.
MINHEIGHT = integer
The MINHEIGHT attribute is used to define a minimum height of the form/window. It must be specified in the attributes of the LAYOUT section.
The unit defaults to a number of grid cells. This is the equivalent of the CHARACTERS in the HEIGHT attribute specification.
See also: MINWIDTH.
01
LAYOUT ( MINWIDTH=60, MINHEIGHT=50 )02
GRID03
...
The MINWIDTH attribute defines the minimum width of a form.
MINWIDTH = integer
The MINWIDTH attribute is used to define a minimum width of the form/window. It must be specified in the attributes of the LAYOUT section.
The unit defaults to a number of grid cells. This is the equivalent of the CHARACTERS in the WIDTH attribute specification.
See also: MINHEIGHT.
01
LAYOUT ( MINWIDTH=60, MINHEIGHT=50 )02
GRID03
...
The NOT NULL attribute sets that the field does not accept NULL values.
NOT NULL
This attribute requires that the field contains a value. If the field contains a default value, the NOT NULL attribute satisfied. To insist on data entry from the user, use NOT NULL in the field definition, or make sure the corresponding column is defined as NOT NULL in the database schema file.
The NOT NULL keywords can also be used in the type definition of FORMONLY fields.
01
EDIT f001 = customer.city, NOT NULL;
The NOENTRY attribute prevents data entry in the field during an INPUT or INPUT ARRAY statement.
NOENTRY
Use the NOENTRY attribute to bypass field input during an INPUT or INPUT ARRAY statement. When using a WITHOUT DEFAULTS dialog option, the content of the corresponding program variable is displayed in the field. A NOENTRY field is like a disabled field, it cannot get the focus.
Note that the NOENTRY attribute does not prevent data entry into a field during a CONSTRUCT statement.
01
EDIT f001 = order.totamount, NOENTRY;
The ORIENTATION attribute defines whether an element displays vertically or horizontally.
ORIENTATION = { VERTICAL | HORIZONTAL }
The ORIENTATION attribute is typically used in the definition of a RADIOGROUP form item, to specify how radio items have to be displayed.
01
RADIOGROUP f001 = customer.status, ORIENTATION=HORIZONTAL;
The PICTURE attribute specifies a character pattern for data entry in a text field, and prevents entry of values that conflict with the specified pattern.
PICTURE = "format-string"
format-string can be any combination of characters, where the characters "A", "#" and "X" have a special meaning.
The PICTURE attribute does not require data entry into the entire field. It only requires that whatever characters are entered conform to format-string.
When PICTURE specifies input formats for DATETIME or INTERVAL fields, the form compiler does not check the syntax of format-string, but your form will work if the syntax is correct. Any error in format-string, however, such as an incorrect field separator, produces a runtime error.
The typical usage for the PICTURE attribute is for (fixed-length) CHAR fields. It is not recommended to use PICTURE for other data types, especially numeric or date/time fields: The current value of the field must always match (i.e. be formatted according to) PICTURE.
Understand that the PICTURE attribute defines a mask for data entry. In order to format fields when data is displayed to the field, use the FORMAT attribute instead. FORMAT is typically used for numeric and date fields, while PICTURE is typically used for formatted character string fields requiring input control.
01
EDIT f001 = carinfo.ident, PICTURE = "AA####-AA(X)";
The PROGRAM attribute can specify an external application program to work with screen fields of data type TEXT or BYTE.
PROGRAM = "editor"
You can assign the PROGRAM attribute to a TEXT or BYTE field to call an external program to work with the BYTE or TEXT values.
Users can invoke the external program by pressing the exclamation point ( ! ) key while the screen cursor is in the field.The external program then takes over control of the screen. When the user exits from the external program, the form is redisplayed with any display attributes besides PROGRAM in effect.
When no PROGRAM attribute is used, the DBEDIT environment variable defines the default editor.
Note that this attribute works in TUI mode only.
The PROPERTIES attribute is used to define a list of widget-specific characteristics.
PROPERTIES = ( { single-property
| array-property | map-property
} [,...] )
where single-property is:
identifier = property-value
and array-property is:
identifier = ( property-value [,...]
)
and map-property is:
identifier = ( item-identifier = property-value
[,...] )
and property-value is:
{ numeric-value | "string-value" }
The PROPERTIES attribute is typically used to define the widget-specific attributes of a WEBCOMPONENT form item.
Note that property names names and values are not checked, to let you freely
set any characteristic of an external widget.
You must verify that the front-end side implementation supports the specified
properties.
01
WEBCOMPONENT f01 = FORMONLY.mycalendar,02
COMPONENTTYPE = calendar,03
PROPERTIES = ( type = "gregorian",04
week_start = 2,05
days_off = ( 1, 7 ),06
dates_off = ( "????-11-25", "????-06-20" ),07
day_titles = ( t1 = "Sunday",08
t2 = "Monday",09
t3 = "Tuesday",10
t4 = "Wednesday",11
t5 = "Thursday",12
t6 = "Friday",13
t7 = "Saterday" )14
;
The QUERYEDITABLE attribute makes a combobox field editable during a CONSTRUCT statement.
QUERYEDITABLE
This attribute is useful when the display values match the real values in the ITEMS attribute.
The REQUIRED attribute forces the user to modify the content of a field during an INPUT or INPUT ARRAY statement.
REQUIRED
This attribute forces the user to modify the content of the field during the dialog execution. If the user subsequently erases the entry during the same input, the runtime system considers the REQUIRED attribute satisfied.
The REQUIRED attribute is effective only when the field name appears in the list of screen fields of an INPUT or INPUT ARRAY statement.If both the REQUIRED and DEFAULT attributes are assigned to the same field, the runtime system assumes that the default value satisfies the REQUIRED attribute.
If the dialog instruction uses the WITHOUT DEFAULTS clause, the current value of the variable linked to the REQUIRED field is considered as a default value; the runtime system assumes that the field satisfies the REQUIRED attribute, even if the variable value is NULL. Note however that in an INPUT ARRAY dialog, the REQUIRED attribute applies always to new created rows, even if WITHOUT DEFAULTS is used.
To insist on a non-null entry, use the NOT NULL attribute instead. The NOT NULL attribute can be specified in the field definition or in the corresponding column in the database schema file.
On character terminals, the REVERSE attribute displays any value in the field in reverse video (dark characters in a bright field).
REVERSE
The SAMPLE attribute defines the text to be used to compute the width of a form field.
SAMPLE = "text"
By default, form fields are rendered by the client with a size determined by the current font and the number of characters used in the layout grid. The field width is computed so that the largest value can fit in the widget.
Sometimes the default computed width is too wide for the typical values displayed in the field. For example, numeric fields usually need less space as alphanumeric fields. If the values are always smaller, you can use the SAMPLE attribute to provide a hint for the front end to compute the best width for that form field.
When specifying the SAMPLE attribute, you do not have to fill the sample string up to the width of the corresponding field tag: The front-ends will be able to compute a physical width by applying a ratio to fit the best visual result. For example, for a sample of 'XY' used for a field defined with 10 characters, is equivalent to specifying a sample of 'XYXYXYXYXY'.
If the SAMPLE attribute is not used, the first 6 cells are always computed with the pixel width of the 'M' character in the current font. Next cells are computed with the pixel width of the '0' (zero) character. In other words, the default sample model is 'MMMMMM000000.....", reduced to the size of the field tag in the layout:
-123456789-123456789- default
sample
[f01
]
MMMM
[f02
]
MMMMMM
[f03
]
MMMMMM0000000000
You can define a default sample for all fields used in the form, by specifying a DEFAULT SAMPLE option in the INSTRUCTIONS section.
See also: DEFAULT SAMPLE.
01
EDIT cid = customer.custid, SAMPLE="0000";02
EDIT ccode = customer.ucode, SAMPLE="MMMMMM";03
DATEEDIT be01 = customer.created, SAMPLE="00-00-0000";
The SCROLL attribute can be used to enable horizontal scrolling in a character field.
SCROLL
By default, the maximum data input length is defined by the width of the item-tag of the field. For example, if you define an CHAR field in the form with a length of 3 characters, users can only enter a maximum of 3 characters, even if the program variable used for input is a CHAR(20).
If you want to let the user input more characters than the width of the item-tag of the field, use the SCROLL attribute.
Note that the SCROLL attribute applies only to fields with character data input.
See also: Field Input Length.
The STRETCH attribute specifies how a widget must resize when the parent container is resized.
STRETCH = { NONE | X | Y | BOTH }
This attribute is typically used with form items that can be resized like IMAGE or TEXTEDIT fields. By default such form items have a fixed width and height, but in some cases you may want to force the widget to resize vertically, horizontally, or in both directions.
01
IMAGE i01 = FORMONLY.image01, STRETCH=BOTH;
The STEP attribute specifies how a value is increased or decreased in one step (by a mouse click or key up/down).
STEP = integer
This attribute is typically used with form items allowing the user to change the current integer value by a mouse click like SLIDER, SPINEDIT.
01
SLIDER s01 = FORMONLY.slider, STEP=10;
The TEXT attribute defines the label associated with a form item, such as the text of a checkbox item.
TEXT = [%]"string"
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED='y', VALUEUNCHECKED='n';
The TITLE attribute defines the title of a form item. Use may be restricted to form fields that make up the columns of a table container; see the documentation for the relevant form item.
TITLE = [%]"string"
01
EDIT col1 = FORMONLY.column1, TITLE="Num";
The VALUEMIN attribute defines a lower limit of values displayed in widgets (such as progress bars).
VALUEMIN = integer
This attribute is typically used in PROGRESSBAR, SPINEDIT and SLIDER fields, to define the lower limit.
See form item type definition for default value.
Note that this attribute is not used by the runtime system to validate the field, you must use the INCLUDE attribute to control value boundaries.
The VALUEMAX attribute defines a upper limit of values displayed in widgets (such as progress bars).
VALUEMAX = integer
This attribute is typically used in PROGRESSBAR, SPINEDIT and SLIDER fields, to define the upper limit.
See form item type definition for default value.
Note that this attribute is not used by the runtime system to validate the field, you must use the INCLUDE attribute to control value boundaries.
The VALUECHECKED attribute defines the value associated with a checkbox item when it is checked.
VALUECHECKED = value
This attribute is used in conjunction with the VALUEUNCHECKED attribute to define the values corresponding to the states of a CHECKBOX.
Note that this attribute is not used by the runtime system to validate the field, you must use the INCLUDE attribute to control value boundaries.
See CHECKBOX definition for more details.
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED=TRUE, VALUEUNCHECKED=FALSE;
The VALUEUNCHECKED attribute defines the value associated with a checkbox item when it is not checked.
VALUEUNCHECKED = value
This attribute is used in conjunction with the VALUECHECKED attribute to define the values corresponding to the states of a CHECKBOX.
Note that this attribute is not used by the runtime system to validate the field, you must use the INCLUDE attribute to control value boundaries.
See CHECKBOX definition for more details.
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED="Y", VALUEUNCHECKED="N";
Indicates that the element cannot be selected by the user for sorting.
UNSORTABLE
By default, a TABLE container allows the user to sort the columns by a left-click on the column header. Use this attribute to prevent a sort on a specific column.
Makes sense only for a field that is used for the definition of a column in a TABLE container.
01
EDIT c01 = item.comment, UNSORTABLE;
Indicates that the columns of the table cannot be selected by the user for sorting.
UNSORTABLECOLUMNS
Same effect as UNSORTABLE, but at the TABLE level, so that none of the table columns can be used for sort.
01
TABLE t1 ( UNSORTABLECOLUMNS )
Indicates that the element cannot be resized by the user.
UNSIZABLE
By default, a TABLE container allows the user to resize the columns by a drag-click on the column header. Use this attribute to prevent a resize on a specific column.
Makes sense only for a field that is used for the definition of a column in a TABLE container.
01
EDIT c01 = item.comment, UNSIZABLE;
Indicates that the columns of the table cannot be resized by the user.
UNSIZABLECOLUMNS
Same effect as UNSIZABLE, but at the TABLE level, to make all columns not resizable.
01
TABLE t1 ( UNSIZABLECOLUMNS )
Indicates that the element cannot be hidden or shown by the user with the context menu.
UNHIDABLE
By default, a TABLE container allows the user to hide the columns by a right-click on the column header. Use this attribute to prevent the user from hiding a specific column.
Makes sense only for a field that is used for the definition of a column in a TABLE container.
01
EDIT c01 = item.comment, UNHIDABLE;
Indicates that the columns of the table cannot be hidden or shown by the user with the context menu.
UNHIDABLECOLUMNS
Same effect as UNHIDABLE, but at the TABLE level, to make all columns not hidable.
01
TABLE t1 ( UNHIDABLECOLUMNS )
The UNMOVABLE attribute prevents the user from moving a defined column of a table.
UNMOVABLE
By default, a TABLE container allows the user to move the columns by dragging and dropping the column header. Use this attribute to prevent the user from changing the order of a specific column. Typically, UNMOVABLE is used on at least two columns to prevent the user from changing the order of the input on these columns.
The UNMOVABLECOLUMNS attribute prevents the user from moving columns of a table.
UNMOVABLECOLUMNS
By default, a TABLE container allows the user to move the columns by dragging and dropping the column header. Use this attribute to prevent the user from changing the order of columns.
The UPSHIFT attribute forces character input to uppercase letters.
UPSHIFT
Assign the UPSHIFT attribute to a character field when you want the runtime system to convert lowercase letters entered by the user to uppercase letters, both on the screen and in the corresponding program variable.
Because uppercase and lowercase letters have different values, storing character strings in one or the other format can simplify sorting and querying a database.Characters entered by the user are converted in INPUT, INPUT ARRAY and CONSTRUCT instructions.
The results of conversions between uppercase and lowercase letters are based on the locale settings (LANG). With single byte runners the conversion of ASCII characters >127 is controlled by the locale settings (the LC_CTYPE environment variable).
01
EDIT f001 = FORMONLY.thetitle, UPSHIFT;
See also: DOWNSHIFT.
VALIDATE is an Action Defaults attribute defining the data validation level for a given action.
VALIDATE = NO
For more details about data validation control when an action occurs, see Interaction Model.
The VALIDATE LIKE attribute instructs the form compiler to set the field attributes that are defined in the .val database schema file for the specified column.
VALIDATE LIKE [table.]column
Note that .val attributes are taken automatically from the schema file if the field is linked to table.column in the field name specification. The VALIDATE LIKE attribute is usually specified for FORMONLY fields.
The VALIDATE LIKE attribute is evaluated at compile time, not at runtime. If the database schema file changes, you should recompile all your forms.
Even if all of the fields in the form are FORMONLY, the VALIDATE LIKE attribute requires the form compiler to access the database schema file that contains the description of table.
01
EDIT f001 = FORMONLY.fullname, VALIDATE LIKE customer.custname;
The INITIALIZER attribute allows you to specify an initialization function that will be automatically called by the runtime system to set up the form item.
INITIALIZER = function
The initialization function must exist in the program using the form file and must be defined with a ui.ComboBox parameter.
Note that the initialization function name is converted to lowercase by fglform. Always use lowercase letters to avoid mistakes.The ITEMS attribute defines a list of possible values that can be used by the form item.
ITEMS = { single-value-list | double-value-list }
where single-value-list is:
( value [,...]
)
where double-value-list is:
( ( value, label-value
) [,...]
)
The list must be delimited by parentheses, and each element of the list can be a simple literal value or a pair of literal values delimited by parentheses.
Note that this attribute is not used by the runtime system to validate the field, you must use the INCLUDE attribute to force the possible values.
The following example defines a list of simple values:
ITEMS = ("Paris", "London", "New York")
The next example defines a list of pairs:
ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"))
This attribute can be used, for example, to define the list of a COMBOBOX form item:
01
COMBOBOX cb01 = FORMONLY.combobox01, ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"));
In this case, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed in the selection list.
When used in a RADIOGROUP form item, this attribute defines the list of radio buttons:
01
RADIOGROUP rg01 = FORMONLY.radiogroup01, ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"));
In this case, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed as the radio button label.
Localization
You can specify item labels with Localized Strings, but this is only possible when you specify a key and a label:
ITEMS = ((1,%"item1"),(2,%"item2"),(3,%"item3"))
Using NULL items
It is allowed to define a NULL value for an item (note that an empty string is equivalent to NULL):
ITEMS = ((NULL,"Enter bug status"),(1,"Open"),(2,"Resolved"))
In this case, the behavior of the field depends from the item type used. For more details, see field type specific notes for COMBOBOX and RADIOGROUP.
The JUSTIFY attribute defines the justification of the content of a field and the alignment of table column headers.
JUSTIFY = { LEFT | CENTER | RIGHT }
With the JUSTIFY attribute, you specify the justification of the content of a field as LEFT, CENTER or RIGHT when the field is in display state. This attribute is ignored for input (i.e. when the field has the focus); only the default data justification rule applies when a field is in input state. The default data justification depends on the dialog type, the field data type and the FORMAT attribute. For example, a numeric field value is right aligned, while a string field is left aligned. The type of dialog also defines the default justification: In a CONSTRUCT, all input fields are left aligned, for search criteria input.
Note that the JUSTIFY attribute can be used with all form item types: Additionally to the field content/data alignment, JUSTIFY defines the alignment of table column headers indirectly (i.e. table column header follows the alignment of field data). However, column header alignment in tables may not be enabled by default; Check the front-end headerAlignment Presentation Style attribute.
You can specify the text alignment of static labels with the JUSTIFY attribute.
01
LABEL t01 : TEXT="Hello!", JUSTIFY=RIGHT;02
EDIT f01 = order.value, JUSTIFY=CENTER;
The SCROLLBARS attribute can be used to specify scrollbars for a form item.
SCROLLBARS = { NONE | VERTICAL | HORIZONTAL |
BOTH }
This attribute defines scrollbars for the form item, such as a TEXTEDIT.
01
TEXTEDIT f001 = customer.fname, SCROLLBARS=BOTH;
The SIZEPOLICY attribute is a sizing directive to display form elements.
SIZEPOLICY = { INITIAL | FIXED | DYNAMIC }
This attribute defines how the front-ends will compute the size of some form elements in grids. The SIZEPOLICY applies only to leaf elements, not to containers. The default value of SIZEPOLICY is INITIAL.
Note that the SIZEPOLICY attribute is ignored for the widgets used in TABLE/TREE columns, because in tables, the size policy is implicitly defined by the cell as fixed (i.e. the size of the column in the form layout).
When the SIZEPOLICY is FIXED, the form elements size is exactly the one defined in the Form Specification File. The size of the element is computed from the width and height in the form grid and the font used on the front-end side.
When SIZEPOLICY is DYNAMIC, the size of the element grows and shrinks according to the width of the wider item during the life time of the application. This can be used for COMBOBOX or RADIOGROUP fields, when the size of the widget must fit exactly to its content, which can vary during the program execution. With SIZEPOLICY=DYNAMIC, Buttons, Labels, Checkboxes, Images and Radio Groups can shrink and grow all the time, while ComboBoxes can only grow.
When SIZEPOLICY is INITIAL, the size is computed the first time the element appears on the screen. Once the widget is displayed, its size is frozen. This is typically used when the size of the element must be fixed but is not known at design time (for instance, when populating a COMBOBOX item list from a database table). This option is also useful when the text of labels is unknown at design time because of Internationalization. With SIZEPOLICY=INITIAL, the behavior differs depending on the form element type. Keep in mind that after the firs the display, the element size will be frozen:
The SIZEPOLICY attribute is supported for WebComponent fields, however as the content and behavior is defined by the front-end, this attribute may have no effect. See the front-end web-component specific documentation for more details.
01
COMBOBOX f001 = customer.city, ITEMS=((1,"Paris"),(2,"Madrid"),(3,"London")), SIZEPOLICY=DYNAMIC;
The SPACING attribute is a spacing directive to display form elements.
SPACING = { NORMAL | COMPACT }
This attribute defines the global distance between two neighboring form elements. In NORMAL mode, the front end displays form elements consistent with the desktop spacing, which is, for example, 6 and 10 pixels on Microsoft Windows platforms. Some overcrowded forms may need to be displayed with less space between elements, to let them fit to the screen. In this case you can use the COMPACT mode.
By default, forms are displayed with COMPACT spacing.
01
LAYOUT ( SPACING=NORMAL )
The SPLITTER attribute forces the container to use a splitter widget between each child element.
SPLITTER
This attribute indicates that the container (typically, a VBOX or HBOX) must have a splitter between each child element held by the container. If a container is defined with a splitter and if the children are stretchable (like TABLE or TEXTEDIT), users can resize the child elements inside the container.
01
VBOX ( SPLITTER )
The STYLE attribute specifies a presentation style for a form element.
STYLE = "string"
This attribute specifies a presentation style to be applied to a form element. The presentation style can define decoration attributes such as a background color, a font type, and so on.
The TAG attribute can be used to identify the form item with a specific string.
TAG = "tag-string"
This attribute is used to identify form items with a specific string. It can be queried in the program to perform specific processing.
You are free to use this attribute as you need. For example, you can define a numeric identifier for each field in the form in order to show context help, or group fields for specific input verification.
If you need to handle multiple data, you can format the text, for example, by using a pipe separator.
01
EDIT f001 = customer.fname, TAG = "name";02
EDIT f002 = customer.lname, TAG = "name|optional";
The TABINDEX attribute defines the tab order for a form item.
TABINDEX = integer
This attribute can be used to define the order in which the form items are selected as the user "tabs" from field to field when the program is using the form field order option.
It can also be used to define which field must get the focus when a folder page is selected.
By default, form items get a tab index according to the order in which they appear in the LAYOUT section.
Tip: TABINDEX can be set to zero in order to exclude the item from the tabbing list. The item can still get the focus with the mouse.
01
EDIT f001 = customer.fname, TABINDEX = 1;02
EDIT f002 = customer.lname, TABINDEX = 2;03
EDIT f003 = customer.comment, TABINDEX = 0; -- Exclude from tabbing list
The VERIFY attribute requires users to enter data in the field twice to reduce the probability of erroneous data entry.
VERIFY
Note that the VERIFY attribute takes effect in INPUT or INPUT ARRAY instructions only, it has no effect on CONSTRUCT statements.
The VERSION attribute is used to specify a user version string for an element.
VERSION = { "string" | TIMESTAMP }
This attribute specifies a version string to distinguish different versions of a form element. You can specify an explicit version string or use the TIMESTAMP keyword to force the form compiler to write a timestamp string into the 42f file.
Typical usage is to specify a version of the form to indicate if the form content has changed. This attribute is used by the front-end to distinguish different form versions and to avoid reloading window/form settings into a new version of a form.
Note that you should use the TIMESTAMP only during development.
01
LAYOUT ( TEXT="Orders", VERSION = "1.23" )
The OPTION attribute specifies widget options for the field.
OPTIONS = "option [...]"
-nolist
(to indicate that the
column should appear as an independent field).This attributes is supported for backward compatibility with Four Js BDS.
The WANTTABS attribute forces a text field to insert TAB characters in the text when the user presses the TAB key.
WANTTABS
By default, text fields like TEXTEDIT do not insert a TAB character in the text when the user presses the TAB key, since the TAB key is used to move to the next field. You can force the field to consume TAB keys with this attribute.
Note that the user can still jump out of the field with Shift-TAB, if this key is not bound to an action.
The WANTNORETURNS attribute forces a text field to reject NewLine characters when the user presses the RETURN key.
WANTNORETURNS
By default, text fields like TEXTEDIT insert a new-line (ASCII 10) character in the text when the user presses the RETURN key. As the RETURN key is typically used to fire the accept action to validate the dialog, you can force the field to reject RETURN keys with this attribute.
Note that the user can still enter new-line characters with Shift-RETURN or Control-RETURN, if these keys are not bound to actions.
The WANTFIXEDPAGESIZE attribute gives a fixed height to a TABLE container.
WANTFIXEDPAGESIZE
By default, the height of a TABLE container is resizable. Use this attribute to freeze the number of rows to the number of screen lines defined by the form file.
The WIDTH attribute defines an explicit width of a form element.
WIDTH = integer [CHARACTERS|COLUMNS|POINTS|PIXELS]
By default, the size of an element is defined in characters and automatically computed by the form compiler according to the size of the form element in the layout.
For items like images, the default width is defined by the number of horizontal characters used in the item tag. You can overwrite this default by specifying the WIDTH attribute. You typically give a number of pixels.
For tables, the default width is defined by the columns used in the table layout. You can overwrite this default by specifying the WIDTH attribute. You typically give a number of columns. This allows you to use tables with a large number of columns, but a small initial width.
If you don't specify any unit, the size unit defaults to CHARACTERS, which defines the number of grid cells.
See also: HEIGHT.
01
TABLE t1 ( WIDTH = 5 COLUMNS )
The WIDGET attribute specifies the type of graphical widget to be used for the field.
WIDGET = "identifier"
This attribute is supported for backward compatibility with Four Js BDS.
When you use the WIDGET attribute, the form cannot be properly displayed on character based terminals, it should only be displayed on graphical front ends.
Symbol | Effect | Other attributes |
Canvas | The field is used as a drawing area. Field must be declared as FORMONLY field. |
None. |
BUTTON | The field is presented as a button widget with a label. | CONFIG: The unique parameter defines
the key to be sent when the user clicks on the button. Button text is
defined in configuration files or from the program with a DISPLAY
TO instruction. For example: CONFIG = "Control-z" |
BMP | The field is presented as a button with an image. | CONFIG: First parameter defines
the image file to be displayed, second parameter defines the key to be
sent when the user clicks on the button. For example: CONFIG = "smiley.bmp F11" Important warning: Image files are not centralized on the machine where the program is executed; image files must be present on the Workstation. See front end specific documentation for more details. |
CHECK | The field is presented as a checkbox widget.
It can be used with the CLASS attribute to change the behavior of the widget. |
CONFIG: First and second
parameters define the values corresponding respectively to the state
"Checked" / "Unchecked" of the check box, while the
third parameter defines the label of the checkbox. For example: CONFIG = "Y N Confirmation" If the text part must include spaces, add {} curly braces around the text: CONFIG = "Y N {Order validated}" If the CLASS attribute is used with the "KEY" value, the first and second parameters defines the keys to be sent respectively when the checkbox is "Checked" / "Unchecked", and the third parameter defines the label of the checkbox as with normal checkbox usage. For example: CLASS="KEY",CONFIG="F11 F12 Confirmation" |
COMBO | The field is presented as a combobox widget.
It can be used with the CLASS attribute to change the behavior of the widget. |
INCLUDE: This attribute defines
the list of acceptable values that will be displayed in the combobox
list. For example: INCLUDE = ("Paris", "London", "Madrid") Important warning: The INCLUDE attribute cannot hold value range definitions, because all items must be explicitly listed to be added to the combobox list. The following example is not supported: INCLUDE = ( 1 TO 10 ) |
FIELD_BMP | The field is presented as a normal editbox, plus a button on the right. | CONFIG: The first parameter defines
the image file to be displayed in the button;
the second parameter defines the key to be sent when the user clicks
on the button. For example: CONFIG = "combo.bmp Control-z" |
LABEL | The field is presented as a simple label, a read-only text. | None. |
RADIO | The field is presented as a radiogroup widget. | CONFIG: Parameter pairs define
respectively the value and the label corresponding to one radio button. For example: CONFIG = "AA First BB Second CC Third" If the radio texts must include spaces, add {} curly braces around the texts: CONFIG = "AA {First option} BB {Second option} CC {Third option}" If the CLASS attribute is used with the value "KEY", the first element of each pairs represents the key to be sent when the user selects a radio button. For example: CLASS="KEY", CONFIG="F11 First F12 Second F13 Third" |
The following list of widgets can be enabled or disabled from programs with a DISPLAY TO instruction:
If you display an exclamation mark in such fields, the button is enabled, but if you display a star (*), it is disabled:
01
DISPLAY "*" TO button1 # disables the button02
DISPLAY "!" TO button1 # enables the button
The text of button fields (WIDGET="BUTTON") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "Click me" TO button1 # Sets text and enables the button
The image of button fields (WIDGET="BMP") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "smiley.bmp" TO button1 # Sets image and enables the button
Note that image files are not centralized on the machine where the program is executed; image files must be present on the Workstation. See front end specific documentation for more details.
The text of label fields (WIDGET="LABEL") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "Firstname" TO l_firstname # Sets text of the label field
The fields declared with the WIDGET="Canvas" attribute can be used by the program as drawing areas. Canvas fields must be defined in the LAYOUT section. A set of drawing functions are provided to fill Canvas fields with graphical elements.
The WINDOWSTYLE attribute defines the style to be used by the parent window of a form.
WINDOWSTYLE = "string"
The WINDOWSTYLE attribute can be used to specify the style of the parent window that will hold the form. This attribute is specific to the LAYOUT element. Do not confuse with the STYLE attribute, which is used to specify decoration style of the form elements.
When a form is loaded by the OPEN WINDOW or DISPLAY FORM instructions, the runtime system automatically assigns the WINDOWSTYLE to the 'style' attribute of the parent window element.
See also: STYLE, Windows and Forms.
01
LAYOUT ( STYLE="BigFont", WINDOWSTYLE="dialog" )
The WORDWRAP attribute enables a multiple-line editor in TUI mode.
WORDWRAP [ { COMPRESS | NONCOMPRESS } ]
Using WORDWRAP fields with character-based terminals results in quite different behavior than with graphical front ends. With character-based terminals, the text input and display is modified by the multi-line editor. This editor can automatically modify the text data by adding blanks to put words to the next line, in order to make the text fit into the form field. In GUI mode, the text input and display is managed by a multi-line edit control.
The maximum number of bytes a user can enter is the width of the form-field multiplied by the height of the form-field. Blank characters may be intentional blanks or fill blanks. Intentional blanks are initially stored in the target variable where entered by the user. Fill blanks are inserted at the end of a line by the editor when a new-line or a word-alignment forces a line-break. It is not possible to set the cursor at a fill blank. Intentional blanks are always displayed (even on the beginning of a line; the word-wrapping method used in reports with PRINT WORDWRAP works differently).
When entering characters with Japanese locales, special characters are prohibited from being the first or the last character on a line. If the last character is prohibited from ending a line, this character is wrapped down to the next line. If the first character is prohibited from beginning a line, the preceding character will also wrap down to the next line. This method is called kinsoku. The test for prohibited characters will be done only once for the first and the last character on each line.
Word-wrapping is disabled on the last row of a WORDWRAP field. The last word on the last row may by truncated. The WORDWRAP COMPRESS attribute instructs the editor to remove fill blanks before assigning the field-buffer to the target variable. The WORDWRAP NONCOMPRESS attribute instructs the editor to store fill blanks to the target variable. The WORDWRAP and WORDWRAP NONCOMPRESS attributes are equivalent.
The EXPANDEDCOLUMN attribute specifies the form field that indicates whether a tree node is expanded. This attribute is optional.
EXPANDEDCOLUMN=column-name
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The IDCOLUMN attribute specifies the form field that contains the identifier of a tree node. This attribute is mandatory.
IDCOLUMN=column-name
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The IMAGECOLUMN attribute defines the form field containing the image of a field.
IMAGECOLUMN=column-name
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The images defined by the IMAGECOLLAPSED, IMAGEEXPANDED and IMAGELEAF attributes take precedence over the images defined by the IMAGECOLUMN cell.
The IMAGECOLLAPSED attribute sets the global icon to be used when a tree node is collapsed. This attribute is optional.
IMAGECOLLAPSED="image-name"
This attribute defines the icon to be used for nodes that are collapsed. It overwrites the program array image defined by IMAGECOLUMN, if both are used.
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The IMAGEEXPANDED attribute sets the global icon to be used when a tree node is expanded. This attribute is optional.
IMAGEEXPANDED="image-name"
This attribute defines the icon to be used for nodes that are expanded. It overwrites the program array image defined by IMAGECOLUMN, if both are used.
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The IMAGELEAF attribute defines the global icon for leaf nodes of a TREE container. This attribute is optional.
IMAGELEAF="image-name"
This attribute defines the icon to be used for all leaf nodes of the tree. It overwrites the program array image defined by IMAGECOLUMN, if both are used.
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The ISNODECOLUMN attribute specifies the form field that indicates whether a tree node has children. This attribute is optional.
ISNODECOLUMN=column-name
Even if the program node does not contain child nodes for this tree node, this attribute may be used, to implement dynamic filling of tree views.
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.
The PARENTIDCOLUMN attribute specifies the form field that contains the identifier of the parent node of a tree node. This attribute is mandatory.
PARENTIDCOLUMN=column-name
This attribute is used in the definition of a TREE container, see the Tree Views page for more details.