ADM Addenda : Container publishes "createObjects" from createObjects
Container publishes "createObjects" from createObjects
Introduced:
OpenEdge R10.1C
The ADM2 container now publishes "createObjects" from createObjects. Contained objects can subscribe to this event to ensure that their createObjects are done before intializeObject is called.
In Release 10.1C, this applies to toolbars and containers, but any ADM2 object can now implement a createObjects method and add the method to its ContainerSourceEvents in order to create widgets or read Repository data before initializeObject is called.
The container class has always subscribed to this event and child containers in Progress Dynamics have always relied on this behavior to ensure that all objects are created before resizing takes place. However, this is a behavior change for ADM2 non-window containers, like SmartFrames and Viewers, since their static container typically did not publish the "createObjects" event beforehand and their createObjects were called from initializeObject.
If you have customized code that relies on a late call to createObjects, there are two options to fix the problem:
Move the customization to initializeObject. This is the recommended solution. The assumption is that, if a customization fails when createObjects is called before initialization, then the customization really belongs in initializeObject.
Unsubscribe these containers from the "createObjects" event. You can do this by adding the following code in the main block of the object. You could also add this code in containrcustom.i if it is general:
RUN modifyListProperty IN TARGET-PROCEDURE
(TARGET-PROCEDURE,
'Remove':U,
'ContainerSourceEvents',
'createObjects').
In environments with Progress Dynamics, this logic also needs checks to avoid that unsubscribing to the event which Progress Dynamics expects. For example, you could bypass the unsubscribe if getUseRepository is true.