Message style attributes
Message presentation style 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:
Attribute | GDC | GBC | GMA | GMI |
---|---|---|---|---|
position Defines the output type of the status bar message field. Values can be:
|
Yes | No | No | No |
textFormat Defines the rendering of the content of the widget. Possible values are:
|
Yes | Yes | No | No |
sanitize
By default, to avoid "Stored XSS"
attacks, the front-end cleans the HTML sent to form elements to ensure no malicious script can be
executed. This security control prevents for example to use HTML content such as |
No | Yes | No | No |