BeforeAction

Description

Occurs after data binding and validation and just before any action is performed.

Applies to

psPage object

Arguments

None

Returns

Boolean. Returning false stops any further processing; returning true allows processing to continue. You must include a return value in the event script.

Usage

This event enables you to do any required preprocessing before the action is initiated.

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 BeforeAction event", true);
return true;

See also