startpagecomplete
This article is about the startpagecomplete UDB event handler.
startpagecomplete
The startpagecomplete event may be called from web pages developed in Web Designer and processed by a USoft page engine service.
| Event | Applies to | Occurs when |
|---|---|---|
startpagecomplete | Page objects (triggered globally on UdbApplication) | At the very end of the page loading process, after the load and pageshow events have already occurred |
This event is triggered internally by the UdbContext class, from its startPage() method, once the entire page-load sequence (data queries, lookups, focus handling, and so on) has finished.
Purpose
You can use this event to run code that must execute only after a page and all of its data are fully loaded and shown, i.e. later than the load and pageshow events allow.
How to use
Find or create an Event Listener object with Event Type = startpagecomplete. Event Listeners are in the Web Designer Controls catalog:
Insert the event listener into the Page 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*){ ... }
Or you can create the event handler more explicitly by calling $.udb.on().
See also pageshow.
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* ::= {
page: *page*,
depth: *depth*,
frameId: *frameId*
}
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*
Page is the name of the page that has just finished loading.
Depth is the page's position (page number) on the navigation stack, which is useful to distinguish between nested pages such as dialogs.
FrameId is the id of the frame that the page was loaded into.