Message style attributes

Message style presentation attributes apply to an ERROR or MESSAGE instruction.

The element type for both ERROR and MESSAGE is Message. To distinguish ERROR from MESSAGE, the ":error" or ":message" pseudo-selectors can be used to specify a different style for the rendering of each instruction: "Message:error" corresponds to the ERROR instruction, and "Message:message" corresponds to the MESSAGE instruction.

The ERROR and MESSAGE instructions can get a STYLE attribute in the ATTRIBUTES clause, to specify a particular style name:

MESSAGE "No rows have been found." ATTRIBUTES(STYLE="info")

A limited set of common style attributes are supported for error/message display. In addition to the attributes described in the section, you can only define font style attributes for messages.

Like simple form fields, TTY attributes have a higher priority than style attributes. By default, ERROR has the TTY attribute REVERSE, which explains why ERROR messages have a reverse background, even when you use a backgroundColor style attribute. Use the NORMAL attribute in ERROR, to avoid the default REVERSE TTY attribute and define your own background color with a style.

Consider centralizing your ERROR and MESSAGE instruction calls in a function, to simplify global modifications:

FUNCTION my_error(m, s)
   DEFINE m, s STRING
   IF s IS NULL THEN
       ERROR m ATTRIBUTES(NORMAL)
   ELSE
       ERROR m ATTRIBUTES(NORMAL, STYLE=s)
   END IF
END FUNCTION

This table shows the presentation attributes for ERROR and MESSAGE instructions:

Table 1. Presentation attributes for ERROR and MESSAGE instructions
Attribute GDC GBC GMA GMI
position

Defines the output type of the status bar message field.

Values can be:
  • "statusbar" (default): will display the text in the regular statusbar of the window.
  • "popup": will bring a pop-up window to the front; it is recommended to use this with care, as overuse can annoy the user.
  • "statustip": will add a small "down" arrow button that will show the pop-up once the user clicks on it. This can be useful to display very long text.
  • "both": will display the text in a pop-up window and then in the status bar.
Yes No No No
textFormat

Defines the rendering of the content of the widget.

Possible values are:
  • "plain" (default): the value assigned to this widget is interpreted as plain text.
  • "html", it is interpreted as HTML (with hyperlinks).
    Important: The HTML content displayed inside a form element using the textFormat:html style must not be a complete HTML document (using CSS styles for example). The content must be simple HTML, with basic tags such as text decoration like <b/> for bold, <ul/>+<li/> for bullet lists, and inline styles.
Yes Yes No No