BeforeGenerate

Description

Occurs before any generation happens. It is triggered both when the page is requested for the first time and when a self-navigation is done. The psPage variable firstTime stores whether or not the page is requested for the first time.

Applies to

psPage object

Arguments

None

Returns

Boolean. If false is returned, generation does not occur. If true is returned, generation occurs normally. You must include a return value in the event script.

Usage

This event is not fired if a Redirect method was called during any previous event. This event is the last chance to modify the data on the server side before generation begins.

NoteError processing Because this event is triggered before generation occurs, you cannot use psDocument.Write to report errors. Instead, use the ReportError method on the psPage object to trigger the ServerError event. The error will then be added to the error log, depending on the ServerError return value.

Examples

Example 1

This script for a JSP target displays a client-side alert box message if the Redirect method is not called for another psPage event:

psPage.Alert (MyVar + " in BeforeGenerate event", true);
return true;

See also

AfterGenerate