@WarningMessage (JavaScript)

Posts a message to a message (Display Error) or messages (Display Errors) control.

Defined in

@Functions (Extension Library)

Syntax

@WarningMessage(message:string, component:any) : void
Table 1. Parameters
Parameter Description
message:string The message.
component:any A component identifier. Specifies the message source.

Usage

This @function does not affect submission of the XPage to the data store.

The @functions @ErrorMessage, @InfoMessage, and @WarningMessage are functionally the same.

Examples

This onchange event for an edit box displays a message depending on user input. A message (Display Error) or messages (Display Errors) control must be present on the page.
val = getComponent("inputText3").value;
if (val == 7 || val == 11) {
	@WarningMessage("Avoid entering 7 or 11 in this field", "inputText3")
} else {
	@InfoMessage("Valid number entered for the field", "inputText3")
}