WriteErrorsToDocument

Description

Writes the current errors at the current place in the page. This method is for 4GL JSP Web pages only.

Applies to

psPage object

Syntax

psPage.WriteErrorsToDocument ( )

Returns

None

Usage

This method must only be called in a server-side script tag, between HTML BODY tags. It allows you to place messages from the error buffer at a precise location on the page.

ReportError must first be called to populate the error buffer. ReportError is called either programmatically or automatically (when the server detects an error). You can then turn off the error display by setting the psPage.showErrorsOnPage property to false.

Examples

Example 1

This example tests whether the user ID is the same as the password entered on a logon page. If the ID and password are not the same, a ReportError method can be called (with an “incorrect password” message as an argument) in the RequestStart or FirstTime event to write an error message to the error buffer. The WriteErrorsToDocument method can then cause the error message to display at the place in the page where this server-side script is called:

<P>
<% user = psDocument.GetParam("user");
password= psDocument.GetParam("password");
if (user == password ) {
  psSession.SetValue("user", user);
  psDocument.Redirect("Home.htm");
  }
else {
  psPage.WriteErrorsToDocument ();
} %> 
</P>

See also

ReportError