Release 10.1A: OpenEdge Development:
ADM Reference

> ## displayFields

> Procedure that displays the current row values by moving them to the viewer’s frame screen-values.

> Location: viewer.p

> Parameters:

> `INPUT `pcColValues` AS CHARACTER`

> CHR(1)-delimited list of the STRING–VALUEs of the requested columns; the first value of this list is the RowIdent value of the corresponding record to be displayed.

> Notes:

> - The pcColValues input parameter contains the field values to be displayed in the SmartDataViewer.

> - displayFields is invoked from resetRecord, cancelRecord, copyRecord, addRecord, and from dataAvailable when the data source has a new row.

> - displayFields runs displayObjects to display values for nondatabase-related fields.

> - When a field is a SmartObject itself (for example, a SmartField object), setDataValue is invoked in the SmartObject to set its value.

> - No RowObject record is available in a SmartDataViewer, so a customization of displayFields cannot refer to the RowObject buffer. You can use the colValues function to access a list of column values from the Viewer’s SmartDataObject if needed, or the columnStringValue function can return the formatted value of a particular field.

> Examples:

>     PROCEDURE displayFields:
>     /*------------------------------------------------------------------------
>       Purpose:     Super Override
>                    This SmartDataViewer gets the handle of its container. If
>                    this is a window, then the title of the window is changed
>                    to reflect the current record.
>       Parameters:
>       Notes:
>     ------------------------------------------------------------------------*/
>     DEFINE INPUT PARAMETER pcColValues AS CHARACTER NO-UNDO.
>       DEFINE VARIABLE hContainerSource  AS HANDLE NO-UNDO.
>        /* Code placed here will execute PRIOR to standard behavior. */
>       hContainerSource = DYNAMIC-FUNCTION(’linkProperty’:U,
>                                 INPUT ’Container-Source’:U,
>                                 INPUT ’ContainerHandle’:U).
>       RUN SUPER( INPUT pcColValues).
>       /* Code placed here will execute AFTER standard behavior.*/
>       ASSIGN
>         hContainerSource:TITLE =
>     "Customer : " + RowObject.NAME:SCREEN-VALUE IN FRAME {&FRAME-NAME}
>                   WHEN VALID-HANDLE(hContainerSource) AND ContainerSource:TYPE =
>     ’WINDOW’:U
>         .
>     END PROCEDURE.
>     PROCEDURE displayFields:
>     /*------------------------------------------------------------------------
>     Purpose:     Super Override
>                  If the value of the country field is ’France’ in this
>                  SmartDataViewer, then make the background color of this
>                  field red.  Otherwise leave it the its default color.
>       Parameters:
>       Notes:
>     ------------------------------------------------------------------------*/
>     DEFINE INPUT PARAMETER pcColValues AS CHARACTER NO-UNDO.
>       /* Code placed here will execute PRIOR to standard behavior.  */
>       RUN SUPER( INPUT pcColValues).
>       /* Code placed here will execute AFTER standard behavior.     */
>       RowObject.Country:BGCOLOR IN FRAME {&FRAME-NAME} =
>       IF RowObject.Country:SCREEN-VALUE = ’France’ THEN 12 ELSE ?.
>     END PROCEDURE.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095