SAS Object-Oriented Programming Concepts |
An event handler is a property that determines which method to execute after an event occurs. Essentially, an event handler is a method that executes another method after an event is received. Use the Class Editor to create event handlers that are specific to an entire class. Use the Properties window to create event handlers that are specific to a single object.
Event Handler Metadata |
SAS/AF software uses a set of event handler metadata to implement and maintain event handlers. This metadata exists as a list that is stored with the class. You can query a class (or an event handler within a class) to view the event handler metadata. You can also create your own metadata list to add or change an event handler. For example, to list the metadata for a particular event handler, execute code similar to the following:
init: dcl num rc; dcl list metadata; dcl object obj; obj=loadclass('sashelp.classes.listbox_c.class'); rc=obj._getEventHandler('_self_','click', '_onClick',metadata); call putlist(metadata,'',3); return;
The following event handler metadata is returned:
(SENDER='_self_' EVENT='visible changed' DESCRIPTION='Refresh myself' STATE='N' METHOD='_refresh' ENABLED='Yes' )
The metadata contains the following named items:
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.