psPage

The psPage object is a global object that resides on the server for 4GL JSP targets. It controls the event model and encapsulates the server-side object model, including a representation of all the form controls in the object model. You must enable the 4GL Web server-side event model in order to create the psPage object.

Properties

psPage property

Datatype

Description

errors[ ]

Vector

The Vector datatype is a collection of PageError objects. PageError is a value class with 3 string attributes: location, cause, and message.

showErrorsOnPage

boolean

Specifies whether errors contained in the errors[ ] array are displayed on the page when the page is generated.

showErrorsAtTop

boolean

Specifies whether errors are displayed at the top or the bottom of the page.

showErrorsInAlert

boolean

Specifies whether errors are displayed in a client-side alert box after the page has completed loading.

pageName

String

The current name of the page.

firstTime

boolean

Indicates whether this is the first time the page was called.

hadValidationError

boolean

Indicates whether a validation error occurred. If an action fails validation and then you change this property to false, the action will occur despite the validation error.

didRedirect

boolean

Indicates whether psPage.Redirect has been called. If it has, generation will not occur.

doTrace

boolean

Indicates whether tracing is enabled. This can be used in the code to check before calling the Trace method multiple times. This property is obsolete. For JSP targets, use the SetTrace and IsTrace methods.

NoteProperties you should not change Changes to the firstTime, hadValidationError, and didRedirect property values are generated dynamically. It is not recommended that you change these values directly in code.

Events

psPage event

Occurs

Order of occurrence

RequestStart

At the beginning of a request

1

FirstTime

The first time a page is loaded

2

BeforeBinding

Just before binding starts

3

Validate

To allow whole page validation

4

ValidationError

If any validate on the page fails

5

AfterBinding

Just after binding completes

6

BeforeAction

Just before the action is performed

7

AfterAction

Just after the action is performed

8

BeforeGenerate

Just before the page is generated

9

AfterGenerate

After all generation is complete

10

RequestFinish

After all generation is complete

11

ServerError

When ReportError() is called

When invoked

Validation and ItemChanged events for controls on the page occur between the psPage BeforeBinding and AfterBinding events. ServerAction events for controls on the page occur between the psPage BeforeAction and AfterAction events.

Methods

psPage method

Description

Alert

Causes client-side alert box to display when the page is finished loading

IsTrace

Indicates whether tracing is enabled

Redirect

Redirects the client's browser to another page

ReportError

Indicates whether a server-side error has occurred

SetTrace

Turns tracing on and off

TestCompError

Tests for errors on EAServer component methods

Trace

Adds a message to the internal trace buffer

TraceIndent

Increases the indent level to indicate nesting

TraceOutdent

Decreases the indent level to indicate nesting

WriteErrorsToDocument

Writes current errors at the current place in the page