Index | OAT homepage | OpenLink Software

OATDOCmessaging

Messaging

How to send & receive inter-control messages

Functions

OAT.MSG.send(sender, message, event)

Dispatches a message.

OAT.MSG.attach(sender, message, callback)

Subscribes to messages.

OAT.MSG.detach(sender, message, callback)

Detaches previously set message receiving handler. All three fields must match.

Example


/* assume that there exists OAT.MSG.CUSTOM_MESSAGE */

function myMessageHandler(source, message, event) {
        alert("Message arrived!"(;
}

/* subscribe to receiving... */
OAT.MSG.attach("*","CUSTOM_.*",myMessageHandler);

/* dispatch message */
OAT.MSG.send(this, OAT.MSG.CUSTOM_MESSAGE, {}); // will invoke myMessageHandler 


Copyright (C) 2005-2009 OpenLink Software