Index | OAT homepage | OpenLink Software


Event handling basics

Event handling is very simple in this toolkit. There are two routines that accomplish this:

OAT.Event.attach(element, event, functionReference)

First argument specifies an element which should detect the event. Second is the event (without the 'on' prefix). Last argument is a valid function reference, i.e., the name of an existing function or Anonymous function.


var div = OAT.Dom.create("div");
OAT.Event.attach(div, "mouseover", function() { alert('Hi!'); });


OAT.Event.attach("some_id", "click", genericFunctionReference);

OAT.Event.detach(element, event, functionReference)

Use the same syntax as inOAT.Event.attach().: ThefunctionReferenceargument must exist in the current scope, so it is not possible to remove aneventhandled by anonymous function.


OAT.Event.detach(element, "click", functionReference);

Copyright (C) 2005-2009 OpenLink Software