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 [-] [|...]]
  1. identifier references a form item definition in the ATTRIBUTES section.
  2. The optional - dash defines the real width of the element.
  3. The | pipe can be used as item tag separator (equivalent to ][).

Usage

An item tag is delimited by square brakets ([]) 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;
...
Each item tag must be indicated by left and right delimiters to show the length of the item and its position within the container layout. Both delimiters must appear on the same line. You must use left and right square brakets ([]) 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
The form item position starts after the open square brace and the length is defined by the number of characters between the square brakets. 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.

For some special items like 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
If the default width generated by the form compiler does not fit, the - 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 make two items appear directly next to each other, you can use the pipe symbol (|) to indicate the end of the first item and the beginning of the second item:
GRID
{
  Info:  [f001    |f002             |f003    ]
}
END
If you need the form to support items with a specific height (more that one line), you can specify multiple-segment item tags that occupy several lines of a grid-area. To create a multiple-segment item, repeat the item tag delimiters without the item identifier on successive lines:
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").

Note: While all repeated item-tags apply to a screen array definition, you must distinguish static screen array columns ("Matrix") defined in a 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
Multi-line list of fields can be defined as follows:
GRID
{
  Multi-line static screen array:
    [f001          ]  [f002          ]
        [f003                                          ]
    [f001          ]  [f002          ]
        [f003                                          ]
    [f001          ]  [f002          ]
        [f003                                          ]
    [f001          ]  [f002          ]
        [f003                                          ]
}
END