Adding an Instance Property to the Smart Panel

Dawn M

Member
Progress v9.1C
UNIX HP UX 11 (server)
Windows 2000 (client)

I'm trying to add an instance property to the Smart Panel (pupdsav.w) that would allow the designer to enable/disable the Add button. I have created copies of the original procedures to modify.

I have followed the steps Progress has given to add a property but I cannot get the functionality to work.

Has anyone done something like this? Any suggestions or code snipets would be greatly appreciated.
 

Dawn M

Member
A little more explaination...

The instance property isn't working. I have the following code in my properties include file (my version of panlprop.i)

DEFINITIONS SECTION:

{src/adm2/custom/paneldefscustom.i}

&IF "{&xcInstanceProperties}":U NE "":U &THEN
&GLOB xcInstanceProperties {&xcInstanceProperties},
&ENDIF

&IF ('{&ADM-Panel-Type}':U BEGINS 'Nav':U)
OR ('{&ADM-Panel-Type}' = 'Toolbar') &THEN
&GLOB xcInstanceProperties {&xcInstanceProperties}~
EdgePixels,PanelType,NavigationTargetName
&ELSE
&GLOB xcInstanceProperties {&xcInstanceProperties}~
EdgePixels,PanelType
&ENDIF

&GLOB xcInstanceProperties {&xcInstanceProperties}~
MyNewProperty


*******************************************************

MAIN BLOCK:

IF "{&ADMSuper}":U EQ "":U &THEN
{src/adm2/panlprto.i}
&ENDIF

/* These preprocessors tell us at compile time what properties can be
retrieved directly from the temp-table. */
&GLOB xpPanelType
&GLOB xpButtonCount
&GLOB xpPanelFrame
&GLOB xpMarginPixels
&GLOB xpBoxRectangle
&GLOB xpPanelLabel
&GLOB xpMyNewProperty
.
.
.

{src/adm2/visprop.i}

&IF "{&ADMSuper}":U = "":U &THEN

/*** STANDARD CODE ***/

&IF ('{&ADM-Panel-Type}':U BEGINS 'Nav':U)
OR ('{&ADM-Panel-Type}' = 'Toolbar') &THEN
/* Navigation-Panel-specific properties */
&ENDIF

&IF ('{&ADM-Panel-Type}':U BEGINS 'Upd':U)
OR ('{&ADM-Panel-Type}':U BEGINS 'Sav':U)
OR ('{&ADM-Panel-Type}' = 'Toolbar') &THEN
/* Update/Save panel-specific properties */
&ENDIF

&IF ('{&ADM-Panel-Type}':U BEGINS 'Commit':U)
OR ('{&ADM-Panel-Type}' = 'Toolbar') &THEN
ghADMProps:ADD-NEW-FIELD('CommitTarget':U, 'CHAR':U, 0, ?, '':U).
ghADMProps:ADD-NEW-FIELD('CommitTargetEvents':U, 'CHAR':U, 0, ?, 'rowObjectState':U).
&ENDIF

/*** MY NEW PROPERTY ***/
ghADMProps:ADD-NEW-FIELD('MyNewProperty':U, 'LOGICAL':U, 0, ?,
FALSE).

&IF DEFINED(PanelDefined) = 0 AND '{&ADM-Panel-Type}':U NE '':U &THEN
/* If Panel-Type is anything else at all, look for p + type + prop.i, */
/* which should contain FIELD definitions *only*. */
{src/adm2/mypanelprop.i}
&ENDIF

{src/adm2/custom/panlpropcustom.i}

*********************************************************

The getMyProperty and setMyProperty functions are in the my new super procedure (my version of panel.p), which is started using my version of panel.i.

When I check the instance properties in the dialog, MyProperty is not there.
 
Looks as though you've forgotten the comma when adding your new property to the xcInstanceProperties list. The xcInstanceProperties list is a comma-serparated list of instance property names, and both the PanelType and NavigationTargetName properties don't have a comma after them.

So what you need is:

&GLOB xcInstanceProperties {&xcInstanceProperties},MyNewProperty
 
Top