postrollback
This article is about the postrollback UDB event handler.
postrollback
The postrollback event may be called from web pages developed in Web Designer and processed by a USoft page engine service.
| Event | Applies to | Occurs when |
|---|---|---|
postrollback | Page objects (triggered globally on UdbApplication) | Right after a rollback action has completed |
This event is triggered internally on the global UdbApplication object, from the rollback() function of the UdbContext class, immediately after the rollback has been performed (and, unless the rollback was requested quietly, after the "rollback performed" message has been acknowledged).
This event is the natural after-companion to beforerollback, which fires before the rollback is performed.
Unlike beforerollback, the postrollback event is not included in the UDB_EVENTS list that the Web Designer Event Listener control routes automatically. This means you cannot currently attach a Web Designer Event Listener with Event Type = postrollback to the Page object; instead, you must attach the handler explicitly by calling $.udb.on('postrollback', function(evt, options){ ... }).
Purpose
You can use the postrollback event to run code that must execute right after a rollback has taken place, for example to refresh UI elements that depend on the rolled-back data.
How to use
Since this event is not routed through a Web Designer Event Listener control, attach the handler explicitly by calling $.udb.on():
$.udb.on('postrollback', function(evt, options){
// your code here
});
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* ::= {
mode: *mode*
}
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*
Mode is the rollback mode that was used for this rollback, i.e. the same mode value that was passed to (or defaulted by) the .rollback() call that triggered this event — for example 'nav' (the default, rolling back to the last navigation checkpoint) or 'single' (undoing a single manipulation).