Consultor Eletrônico



Kbase P104354: How do I ensure that code is not executed my SmartObjects when they are running in design mode withi
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/05/2005
Status: Unverified

GOAL:

How do I ensure that code is not executed my SmartObjects when they are running in design mode within the AppBuilder?

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

FIX:

When you open a SmartObject in the AppBuilder any embedded SmartObjects within that SmartObject are initialized so that we can show you what the SmartObject looks like. For example, when a SmartWindow is opened any SmartViewers are also initialized so you can see the widgets on the screen.
Because of this it is possible that code you have added to these embedded SmartObjects will be executed and have unintended side effects (i.e. enabling fields, opening queries, enabling toolbars, etc). As the developer, you need to guard against this by inserting code to check what mode the SmartObject is running in and only executing your code when the object is running 'live'. To do this use code like the following:
IF DYNAMIC-FUNCTION('getUIBMode':U) <> 'Design' THEN /* Not Running in Design Mode in the UIB/AppBuilder */
DO:
/* Your code goes here */
END.