Events Package - AFS

AFS Integration Guide

Reference Guide

This package aims to provide tools to work with application events. All existing application events can be accessed in one place, in one way. This package is available in:

Some events are currently supported. The list can be consulted in and is shown below. In the future, this list can receive new additions.


  • The wildcard event '*' allows to be notified of any occurring event.
  • The '*-reply-dispatch' event family is related to an AFS search and allows to be notified before or after widgets handle a new response.
  • The 'login' and 'logout' events are raised after a new CKS authentication state.
  • The '*-added', '*-updated' and '*-deleted' event families notify status of managed CKS objects.

To be notified upon new events, a on() function is provided and allows to attach a listener.

Here are some examples.

function onAppReady()
{'login', function(eventName, data){
sayHello(data.firstName + ' ' + data.lastName);
});'*', function(eventName, data){
if (eventName == "login") {
sayHello(data.firstName + ' ' + data.lastName);
else if (eventName == "logout") {
sayGoodbye(); // here data is undefined

Be sure the SDK is available and ready to use before making calls to it. See 'appReadyCallback' in SDK configuration.

Each handler receives two parameters. The first is the event name (not useful in most cases), the second contains data associated to the event if it makes sense. The content of these data is not detailed here since it depends on the event. Use the browser console and/or debugger to inspect the passed JSON objects.

Many handlers can be attached to a same event.

All events raised by the application are registered in the array. This array can be consulted and cleared as wanted.