Progress
ADM 2 Reference
initializeObject (smart.p)
Performs general initialization common to all objects.
Parameters: NoneReturns: Nothing (procedure)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 Progress 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 will run initializeObject. This passes the initializeObject event down through all the contained objects. Thus any version of initializeObject can assume that all the SmartObjects and SmartLinks in a container have been established; thus it can check, for example, whether there is a link to some other particular kind of object. Code should not, however, assume the order in which SmartObjects will be initialized. For example, a SmartDataObject will open its query and publish
“
dataAvailable”
to signal that to other objects. A SmartDataViewer will run 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 © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |