sample

The sample property defines the text to be used to compute the width of a formField.

Usage

By default, formFields 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 property to provide a hint for the front end to compute the best width for that formField.

When specifying the sample property, 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 property 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.