Kbase P20153: How to change fields label into a smart viewrer based on a p
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/02/2003 |
|
Status: Unverified
GOAL:
How to change fields label into a smart viewrer based on a profile table
FACT(s) (Environment):
Progress 9.1x
FIX:
Create a SDO for profile table. Add a function to SDO which will return the list of labels you want to retrieve, for example "getLabelsList" .
Insert the "profile" SDO into container.
Create a custom link between "profile" SDO and Viewer, for example "PROFILE" .
Add the following code to displayField of the smart viewer:
/* Code placed here will execute AFTER standard behavior. */
DEF VAR vh AS HANDLE.
vh = WIDGET-HANDLE( DYNAMIC-FUNCTION('linkHandles':U, INPUT "PROFILE-SOURCE" ) ).
IF NOT VALID-HANDLE( vh ) THEN RETURN. /* no profile SDO linked */
DEF VAR vcLabels AS CHARACTER.
vcLabels = DYNAMIC-FUNCTION( 'getLabelsList' IN vh, <key1>, <key2>, ... ).
/* where <key1>, <key2>, ... depends on how you want to locate profile */
/* records */
IF vcLabels = ? THEN RETURN. /* no profile records available */
ASSIGN
fld-1:LABEL IN FRAME {&FRAME-NAME} = ENTRY( 1, vcLabels )
fld-2:LABEL IN FRAME {&FRAME-NAME} = ENTRY( 2, vcLabels )
...
fld-N:LABEL IN FRAME {&FRAME-NAME} = ENTRY( N, vcLabels )
.
END PROCEDURE.