problem adding a button in toolbar

sseguron

New Member
Hi, as you mentioned I followed steps indicated in John Sadd toolbar paper just to add a new button (equivalent to his Print button) into the FUNCTION group.
I modified as indicated actioncustom (over of initAction) toolbarcustom (over of setButtons).
The button effectively appears but never get to be enabled (despite an unconditionnal call to enableActions for this action in SetButtons).

Here is the complete code I wrote :

actioncustom.p :

initaction (override) :

DEF VAR xcColumns AS CHAR INIT
"Name,Caption,Image,Type,OnChoose,Parent":U.

&SCOP dlmt + CHR(1) +

RUN SUPER.

DYNAMIC-FUNCTION ('defineAction':U IN TARGET-PROCEDURE,
"Excel":U,
xcColumns,
"Excel" {&dlmt}
"Excel" {&dlmt}
"exit.bmp":U {&dlmt}
"PUBLISH":U {&dlmt}
"exportExcel":U {&dlmt}
"FUNCTION":U
).

toolbarcustom.p :

setbuttons (override) :

DEFINE INPUT PARAMETER pcState AS CHAR NO-UNDO.

DYNAMIC-FUNCTION
('enableActions':U IN TARGET-PROCEDURE, 'Excel':U).

RUN SUPER(pcState).

END PROCEDURE.


Thanks in advance.:confused: :confused:
 
I had the same problem
Until i added the target procedure in the container
Procedure Exportxcel /*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
MESSAGE 'Excel' VIEW-AS ALERT-BOX.
END PROCEDURE.
And voila the button was enabled

by the way , quitting the session and retarting sometimes helps to
( all superprocedures stay persistent , and changing actionscustom.p only works the next time it is reloaded in memory :blush:)
 
Back
Top