Item tags
Item tags define the position and size in a grid-based container.
Basics
An item tag defines the position and size of a simple form item, as leaf nodes in the structure of a form definition. Item tags are used to define form input fields, as well as other form items such as static images and static labels.
Item tags as used in a grid-area of a GRID
or SCROLLGRID
container,
and are also used to define TABLE
and TREE
columns.
Syntax
[ ] { } |
symbols are part of the syntax.[identifier ]
[identifier-1 |identifier-2 ... ]
[identifier - ]
- identifier references a form item definition in the
ATTRIBUTES
section. - The
-
hyphen-minus defines the real width of the element. - The
|
pipe can be used as item tag separator, that will occupy a single form grid cell.
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
[
open square bracket and the length is
defined by the number of characters between the square brackets. The following example defines a
form item starting at position 3, with a length of 2: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
-
hyphen-minus 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.
- Static field sets in a
GRID
container, - Columns of a
TABLE
(orTREE
) container, or - Fields of a
SCROLLGRID
container with a fixed number of rows (withoutWANTFIXEDPAGESIZE=NO
).
Example using a GRID
container:
LAYOUT
GRID
{
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
[f001 ] [f002 ] [f003 ]
}
END
END
ATTRIBUTES
f001 = FORMONLY.field1;
f002 = FORMONLY.field2;
f003 = FORMONLY.field3;
END
INSTRUCTIONS
SCREEN RECORD my_screen_array (FORMONLY.*);
END
GRID
{
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
[f001 ] [f002 ]
[f003 ]
}
END
TABLE
columns:TABLE
{
[c1 |c2 |c3 ]
[c1 |c2 |c3 ]
[c1 |c2 |c3 ]
}
END
GRID
container:GRID
{
[f001 ] [f001 ] [f001 ] [f001 ] [f001 ] [f001 ]
[f002 ] [f002 ] [f002 ] [f002 ] [f002 ] [f002 ]
[f003 ] [f003 ] [f003 ] [f003 ] [f003 ] [f003 ]
}
END