EventListener procedures are used to perform custom actions in reaction to Server Events.
A procedure of this type has the following structure:
1 2 3 4 5
var listeners = { "EventName1": function(context, event) {}, "EventName2": function(context, event) {}, ... };
Important
The listeners variable must be a JS object where each entry has a key naming the Event to be listened for, and the value being the function that will run in reaction to the event occurring.
listeners
See Event for a complete list of which events can be listened for.
To configure an EventListener procedure, you must first create a Event-listener-procedure containing the script itself, then link to it from an Event-listener instance.
Notice that merely creating a procedure is not enough for the event-listener to become active. It must be added to the list of event-listener-procedures to become active.
event-listener-procedures
EventListener procedures have access to all of the Common Procedure API.
Each listener function takes two arguments: the context object, as well as the event itself.
context
event
The context has type EventListenerProcedureContext.
The event will be of the type the function listens for, or a sub-type of it.
function
Implementation of an event listener. param context:The context object for event-listener-procedures param event:The event object, which will be of the type listened for or one of its sub-types. returns:nothing
Implementation of an event listener.