Kbase P182616: Cannot conditionally close SmartDialog in initializeObject override
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/15/2011 |
|
Status: Unverified
SYMPTOM(s):
Cannot conditionally close SmartDialog in initializeObject override
Dialog box stays open when WINDOW-CLOSE is applied to dialog frame after RUN SUPER in initializeObject
Dialog box stays open when GO is applied to dialog frame after RUN SUPER in initializeObject
Dialog box stays open when CHOOSE is applied to Btn_Cancel after RUN SUPER in initializeObject
FACT(s) (Environment):
Code is added to initializeObject to test for certain conditions and prevent the display of the SmartDialog if the conditions are not met
Windows
OpenEdge 10.x
CAUSE:
AppBuilder automatically includes src/adm/dialogmn.i in the main block when a SmartDialog is added to the application. dialogmn.i contains a typical main block that runs initializeObject and follows it with a WAIT-FOR to block for user input:
MAIN-BLOCK:
DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
RUN initializeObject.
WAIT-FOR GO OF FRAME {&FRAME-NAME} {&FOCUS-Phrase}.
END.
There is no test for ERROR or END-KEY (or any other condition) between initializeObject and the WAIT-FOR, so the WAIT-FOR is always executed and requires user input to break out of the block.
FIX:
If it is necessary to prevent the display of a SmartDialog under certain conditions, use a custom version of src/adm/dialogmn.i in place of the the standard include file. Add code to the custom version so that the WAIT-FOR is not executed when the appropriate conditions apply.