TEXTEDIT item type

The TEXTEDIT item type defines a multi-line edit field.

Rendering


TEXTEDIT item type screenshot

Figure 1. TEXTEDIT item type

Syntax

TEXTEDIT item-tag = field-name [ , attribute-list ] ;
  1. item-tag is an identifier that defines the name of the item tag in the layout section.
  2. field-name identifies the name of the screen record field.
  3. attribute-list defines the aspect and behavior of the form item.

Attributes

COLOR, COLOR WHERE, COMMENT, DEFAULT, DOWNSHIFT, FONTPITCH, HIDDEN, INCLUDE, JUSTIFY, KEY, NOT NULL, NOENTRY, PROGRAM, REQUIRED, SAMPLE, SCROLLBARS, SIZEPOLICY, STYLE, STRETCH, TAG, TABINDEX, UPSHIFT, VALIDATE LIKE, WANTTABS, WANTNORETURNS.

Table column only: UNSORTABLE, UNSIZABLE, UNHIDABLE, UNMOVABLE, TITLE.

Usage

The TEXTEDIT form item type allows the user to enter a long text on multiple lines.

By default, when the focus is in a TEXTEDIT field, the Tab key moves to the next field, while the Return key adds a newline (ASCII 10) character in the text. To control the user input when the Tab and Return keys are pressed, you can specify the WANTTABS and WANTNORETURNS attributes. When you specify WANTTABS, the Tab key is consumed by the TEXTEDIT field, and a Tab character (ASCII 9) is added to the text. The user can still jump out of the field with the Shift-Tab combination. When you specify WANTNORETURNS, the Return key is not consumed by the TEXTEDIT field, and the action corresponding to the Return key is triggered. The user can still enter a newline character with Shift-Return or Ctrl-Return.

You can use the SCROLLBARS attribute to define vertical and/or horizontal scrollbars for the TEXTEDIT form field. By default, this attribute is set to VERTICAL for TEXTEDIT fields. The STRETCH attribute can be used to force the TEXTEDIT field to stretch when the parent container is re-sized. Values can be NONE, X, Y or BOTH. By default, this attribute is set to NONE for TEXTEDIT fields. Note that using either the SCROLLBARS or the STRETCH attribute will automatically set the SCROLL attribute, to bypass the size limit defined by the screen tag and use the size of the program variable instead. For more details about size limitation, see the SCROLL attribute definition.

Some front-ends support different text formats which can be controlled by a style attribute. You can for example display and input HTML content in a TEXTEDIT.

A TEXTEDIT can also be used to edit rich text format. Depending on the front-end, different formatting options are available (bold, font size, and so on) and can be controlled using either an integrated toolbox or via local actions. In this case, the value of the field will be an HTML representation of the text and its decoration.

Please note that:

  • Each front-end uses its own technology to provide HTML support in TEXTEDIT fields, and the HTML representation may vary between front-ends. As result, the same HTML content may display in a different way on another front-end.
  • When using rich text, FGL_DIALOG_SETCURSOR() and FGL_DIALOG_SETSELECTION() functions must be called carefully: because of the richtext format, having a corresponding cursor position / selection between displayed text and HTML representation may be difficult, especially in case of hidden parts.
TEXTEDIT f001 = customer.address,
   WANTTABS, SCROLLBARS=BOTH;