sysLib.setError

The system function sysLib.setError associates a message with an item in a page handler or with the page handler as a whole. The message is placed at the location of a JSF message or messages tag in the JSP and is displayed when the related Web page is displayed.

If a validation function invokes sysLib.setError, the Web page is re-displayed automatically when the function ends.


sysLib.setError syntax diagram

itemInError

The name of the page-handler item that is in error.

this

Refers to the page handler from which sysLib.setError is issued. In this case, the message is not specific to an item, but is associated with the page handler as a whole. For details on this, see References to variables and constants.

msgKey

A character item or literal (type CHAR or MBCHAR) that provides the key into the message resource bundle or properties file used at run time. If the key is blank, the message is a concatenation of message inserts.

itemInsert

The character item or literal that is included as an insert to the output message. The substitution symbol in message text is an integer surrounded by braces, as in this example:
  Invalid file name {0}

msgText

The character item or literal that you can specify if you do not specify other arguments. The text is associated with the page as a whole.

You can associate multiple messages with an item or page handler. The EGL run time displays the messages when the page is re-displayed. If control is forwarded (specifically, if the page handler runs a forward statement), those messages are lost.

Related concepts
PageHandler part
References to variables and constants

Related tasks
Syntax diagram

Related reference
forward