Skip to main content
Version: 11.2

after

note

This article is about the after UDB event handler.

after​

The after event may be called from web pages developed in Web Designer and processed by a USoft page engine service.

EventApplies toOccurs when
afterData source objects (UdbDataSource)After a Page Engine action that involves the data source has been completed

This event is triggered by the UdbDataSource class (via dsc.trigger('after', ...)), once the server response for the action has been processed. Note that for the getDataSet action specifically, this event is only fired when the action is a "replace" (i.e. event.getParam('replace') is true); a plain, non-replace getDataSet() call does not fire after. For any other Page Engine action that involves the data source, the event always fires. The after event is raised as a consequence of the server handling Page Engine requests. This contrasts with the afterrender event, which is related to UI (i.e. non-server) events.

Purpose​

You can use the after event to hide waitstates that you have started showing on the before event.

How to use​

Find or create an Event Listener object with Event Type = after. Event Listeners are in the Web Designer Controls catalog:

Insert the event listener into the data source object. Insert a callClientScript action into the event listener. Use this action's Script property to code the behaviour that you want to see when the event occurs.

You are implicitly associating the event with an event handler function. This function has an options parameter. For available options, see the Options section at the end of this help topic:

function(*event*, *options*){ ... }

Options​

When the event occurs, the following event handler function is called. You can use this function's options parameter in your event scripting.

function( *event*, *options* )

*event* ::= jQuery.Event
*options* ::= *event-options*

*event-options* ::= {
action: *action*,
source: *source*,
args: *args*,
pKeys: *pKeys*,
showdata: *showdata*
}

Event contains the run-time details of the triggered event, of the event type stated above.

This syntax means that you can access an option by scripting:

options.*option*

Action is the name of the Page Engine action that has completed, e.g. 'getDataSet'.

Source indicates what caused the action to be executed.

Args are the arguments that were passed to the action.

pKeys identifies the rowset that the action was performed on.

Showdata indicates whether the resulting data should be shown.