Adding new instance property to all SmartObjects

KWSMaster

New Member
I've been working on extending the ADM2 SOs for our new GUI project. I've added a new instance property to the entire SO tree by editing the smrtpropcustom.i and other associated smart.p customization objects to add this property:

Code:
ghADMProps:ADD-NEW-FIELD('ImpSmartSecurity', 'CHARACTER', ?, ?, '').

I added all the get and set routines to this module, and modified all the other files to add the various &GLOB entries. Everything works, except for two specific cases: dynamic smarttoolbars, and dynamic databrowsers. In both of these cases, the instance properties for the objects are not being honored, and instead all you see in the constructobjects for these SOs is as follows:

Code:
       RUN constructObject (
             INPUT  'adm2/dyntoolbar.w':U ,
             INPUT  FRAME fMain:HANDLE ,
             INPUT  'ImpSmartSecurity':U ,
             OUTPUT h_dyntoolbar ).

What am I doing wrong? Is there something special I have to do to correct this?
 
:blush: Figured it out. In one of the documentation pieces on extending smartobjects, it is indicated that you add a property on to the instance property global define using something like:
Code:
&glob xpInstanceProperty [propertyname]
In the custom property include files. However, what you REALLY need to do is copy the code used to do this addition right from the adm. I got it from the toolbar property include, but it could be obtained from any of the root object files in the c:\program files\progress\src\adm2 folder.

That was the waste of a better part of 2 days. Hopefully the docs and whitepapers on this will be cleared up eventually.

Does anyone else find extending the ADM2 code to be as tedious and disgusting as I do? Delphi might have had some serious issues, but at least they got the basic object model right the first time :brick:
 
you should send it to someone at progress headquarters, so that they will be informed of your problem and they might take some action to resolve it.
 
Extending Smart Objects

First, I do agree that the way you are trying to extend the smartObjects ie by creating your own master or template IS the way to do it! For product development stand point - this is the way to go provided the role of the object as a component is quite well defined! :)

That being said, For the present project, I am extending my objects just by including my own super procedures! some times I used Publish/subscribe when One action can affect multiple objects at run time.

as far as setting and getting properties - smart.p has upper lever functions - 'setUserProperty' and 'getUserProperty' - I use them.

(I started working on this project after a cowboy already had done his best to mess up the design - dude was so great, he was committing customer records on the table using CREATE statement in the CUSTOMER SDO itself- did not have time to create my templates from scretch, cried and moaned and re-coded his crap.
I have a coplete set of generic and reusable code based on the way I described)
 
Back
Top