Release 10.1A: OpenEdge Development:
Progress 4GL Handbook

> ## Building a comprehensive example

> This section examines a more comprehensive example of a useful set of procedures that include dynamic objects to display data from any database table or temp-table. It serves as a summary and review of all the material in this and the previous chapters on dynamic objects. The code is somewhat too substantial to describe in full, so the material refers to selected parts of the procedures. You can then examine the final procedures in the examples directory.

> The main procedure is `h-dbbrowser.w`, which puts up a window where you can select a database (if there’s more than one connected), a table, and one or more fields from that table. The procedure displays those fields in a dynamic browse. Figure 20–2 shows an example using the Customer table from the Sports2000 database.

> Figure 20–2: Result of running h-dbbrowser.w

> Look at some of the code that makes this happen.

> The main block of `h-dbbrowser.w` runs an `initializeObject` procedure and then a custom `enableUI`:

>     DO ON ERROR  UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
>        ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
>       RUN initializeObject.
>       RUN enableUI.
>       IF NOT THIS-PROCEDURE:PERSISTENT THEN
>        WAIT-FOR CLOSE OF THIS-PROCEDURE.
>     END.

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