Assigns the controller (a collection of the related event handlers).
nullobj.setController(name, value);
name (string) - controller name
value (object) - associative array of event name/event handler pairs
obj.setController("myTabKeys", {
onKeyTab: "selectNextRow",
onKeyShiftTab: "selectPreviousRow"
});
There are two ways of adding event listeners to AW controls. The simple one, intended for the control users, is attaching the event handler to the object itself
obj.onCellMouseOver = eventHandlerFunction;
There is also another method, intended for the control developer, where you can attach/remove/replace a group of related event handlers, called 'controller'. The controller is just an assosiative array of eventName:eventHandlerFunction pairs
var mouseController = {
onCellMouseOver: function1,
onCellMouseOut: function2
};
You can assign the controller using setController(name, controllerObject) method
obj.setController("mouse", mouseController);
Several controllers can contain handlers for the same event, in this case all of them will be executed. The event handler attached directly to the object will be executed first and returning non-zero error code will cancel execution of event handlers in the controllers.
The controllers support special case where you can specify the name of other event instead of actual event handler -
var keyboardController = {
onKeyLeft: "selectPreviousCell",
onKeyRight: "selectNextCell"
};
var selectionController = {
selectPreviousCell: function1,
selectNextCell: function2
};