Item tags
Item tags define the position and size in a grid-based container.
An item tag defines the position and size of a simple form item in a grid-area of a
GRID
or SCROLLGRID
container. Form items defined with item tags
are leaf nodes in the structure of a form definition, such as a form field (meaning that it is not a
container form item).
Syntax
[identifier [-] [|...]]
- identifier references a form item definition in the
ATTRIBUTES
section. - The optional
-
dash defines the real width of the element. - The
|
pipe can be used as item tag separator (equivalent to][
).
Usage
An item tag is delimited by square brackets ([]
) or pipes (|
) and
contains an identifier used to reference the description of the form item in the
ATTRIBUTES
section. In this example, the identifier of the form item is
"f01
", and the form item type is BUTTONEDIT
:
LAYOUT
GRID
{
...
[f01 ]
...
}
END
...
ATTRIBUTES
BUTTONEDIT f01 = customer.cust_name, ACTION=zoom;
...
[]
) to delimit item tags. The number of characters and the
delimiters define the width of the region to be used by the
item:GRID
{
Name: [f001 ]
}
END
GRID
{
1234567890
[f1]
}
END
By default, the real width of the form item is defined by the number of characters used between the tag delimiters.
BUTTONEDIT
, COMBOBOX
and
DATEEDIT
, the width of the field is adjusted to include the button. The form
compiler computes the width as: width=nbchars-2 if
nbchars>2:GRID
{
1234567
[f1 ] -- this EDIT gets a width of 7
[f2 ] -- this BUTTONEDIT gets a width of 5 (7-2)
}
END
-
dash
symbol can be used to define the real width of the item. In this example, the form item occupies 7
grid cells, but gets a real width of 5 (this means for an EDIT field, you are able to enter 5
characters):GRID
{
1234567
[f1 - ]
}
END
|
) to indicate the end of the first item and the beginning of the second
item:GRID
{
Info: [f001 |f002 |f003 ]
}
END
GRID
{
Multi-segment: [f001 ]
[ ]
[ ]
[ ]
[ ]
}
END
The notation applies to the new LAYOUT
section only. For backward
compatibility (when using a SCREEN
section), multiple-segment items can be
specified by repeating the identifier in sub-lines.
If the same item tag (that is with the same identifier) appears more than once in the layout, it defines a column of a screen array (also known as "Matrix").
GRID
container, from TABLE
(or TREE
)
column definitions and SCROLLGRID
row templates.Example:
GRID
{
Single-line static screen array:
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
}
END
...
ATRIBUTES
f001 = FORMONLY.field1;
f002 = FORMONLY.field2;
f003 = FORMONLY.field3;
END
INSTRUCTIONS
SCREEN RECORD my_screen_array (FORMONLY.*);
END
GRID
{
Multi-line static screen array:
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
}
END