Release 10.1A: OpenEdge Development:
ADM Reference

> ## initializeObject

> Procedure that performs general initialization common to all objects.

> Location: smart.p

> Parameters: None

> Notes:

> - There is a version of initializeObject in virtually every Super procedure; each performs the initialization appropriate to that class of objects. This top-level version runs the createControls and control_load procedures, if they exist, to initialize ActiveX Controls in the object, and sets the ObjectInitialized property to TRUE.

> - Initialization of SmartObjects takes place in two phases. In the first phase, the constructObject procedure is run (normally from the AppBuilder-generated procedure adm–create–objects) for each SmartObject in a SmartWindow or other container. This runs the persistent procedures which instantiates the object and initializes Instance Properties for which values have been defined. adm–create–objects then creates links between objects. Once this is complete, the container runs initializeObject. This passes the initializeObject event down through all the contained objects. Therefore, any version of initializeObject can assume that all the SmartObjects and SmartLinks in a container have been established and that they can be checked, for example, whether there is a link to some other particular kind of object. Code should not, however, assume the order in which SmartObjects are initialized.

> For example, a SmartDataObject opens its query and publishes dataAvailable to signal that to other objects. A SmartDataViewer runs dataAvailable in itself to see if there is already a row waiting for display, which would happen if the associated SmartDataObject was initialized first.

> - Application code can therefore localize createObjects in a SmartContainer to add code to the creation phase (for example, to define additional application-specific links or set application-specific properties that need to be looked at during initialization), or to initializeObject to add code to the initialization phase after all objects have been created and all links created. For noncontainer SmartObjects, code to be executed during the creation phase (that is, when the object’s procedure is first run) should be placed in the Main Block. Code to be executed after the object and other related objects have been created should be placed into a local initializeObject.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095