Hi,
It's best not to create your menu dynamically in the definitions(youcan of course do it, but since this is a dynamic menu it is notreallya definition (definitions are declarations of variables,temp-tablesetc).
So, create your menu somewhere in the actual code, for instance inaninternal procedure that you can run when you create your dynamicbrowse(return the handle of the menu as an output parameter).
Like I said in my previous post, when you dynamically createwidgets(and a dynamic menu is a collection of widgets) you need touse"PERSISTENT-RUN" in the triggers.
You can then get something like this in your code (very much simplified):
Code:
..
..
Some code goes here
..
..
CREATE BROWSE brMyBrowser
ASSIGN FRAME =
DOWN =
(etc)
TRIGGERS:
END TRIGGERS.
RUN ipCreatePopup (OUTPUT menuHandle).
ASSIGN brMyBrowser:POPUP:MENU = menuHandle.
..
..
Some code goes here
..
..
PROCEDURE ipCreatePopup:
DEF OUTPUT PARAMEYET opMenuHandle AS HANDLE NO-UNDO.
CREATE MENU opMenuHandle
ASSIGN POPUP-ONLY = TRUE
TITLE = "Kontextmenue".
CREATE MENU-ITEM ia ASSIGN
PARENT = popmenu
LABEL = "Buchungs-Info"
TRIGGERS:
ON CHOOSE PERSISTENT RUN ipMenuClicked IN THIS-PROCEDURE (INPUT ia).
END TRIGGERS.
END PROCEDURE.
PROCEDURE ipMenuClicked:
DEF INPUT PARAMETER ipMenuItem AS HANDLE NO-UNDO.
MESSAGE ipMenuItem:LABEL " has just been clicked."
VIEW-AS ALERT-BOX INFORMATION.
END PROCEDURE.