Kbase P74767: Dynamics/ADM2: How to apply ENTRY to a SmartDataField (lookup/combo)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  01/04/2004 |
|
Status: Unverified
GOAL:
How to apply ENTRY to a lookup or combo (SmartDataField)
GOAL:
How to put the focus in a smartDataField
FIX:
The following code run from a viewer will not work if myFieldName is a SDF:
myHandle = widgetHandle("").
APPLY "ENTRY" TO myHandle.
=> because myHandle is not the handle of the FILL-IN widget, but the handle of the SDF rendering procedure (adm2/dynlookup.w or adm2/dyncombo.w).
The solution is to do the following:
myHandle = widgetHandle("").
IF myHandle:TYPE = PROCEDURE
THEN RUN applyEntry IN myHandle ("") NO-ERROR. /*myHandle is a SDF*/
ELSE APPLY "ENTRY" TO myHandle. /*myHandle is a widget*/
Or even:
myHandle = widgetHandle("").
IF myHandle:TYPE = PROCEDURE
THEN RUN applyEntry IN myHandle ("") NO-ERROR. /*myHandle is a SDF*/
ELSE RUN applyEntry IN TARGET-PROCEDURE /*the viewer*/ ("").
/*myHandle is a widget*/