Hello again, I try to make some generic actions to handle the application logic for dialog management. In order to know the last dialog shown, I added a postShown event, and in the action of this event I am using the api_application.getClientEvent() api call. I expected the calling object to be the dialog but using the t_event.objectName_tx I am getting the grid where the popup-menu is attached. Not event the popup menu-item, nor the popup-menu that are in between!
Using the api_application.getFocusedDialog returns the mainFrame of the application.
A working shortcut is to set a session variable in the action that displays the dialog to the dialog name, and use this session variable when needed. This works fine if the dialogs are modal.Is there another way to get t?
asked 06 Sep '12, 07:59
You need to use API_APPLICATION.getEvent API to get current event details. The API_APPLICATION.getClientEvent API that you used returns the event which is triggered by user. For instance; you open the dialog by using menuitem in popup-menu. In postShow event of dialog; - API_APPLICATION.getClientEvent returns MenuItemClick event - API_APPLICATION.getEvent returns dialog PostShow event
By the way, API_APPLICATION.getFocusedDialog API should return current active window on screen. In your case, the dialog is not active yet in postShow event. So you get the mainFrame as focused window.
answered 06 Sep '12, 08:42