Progress
Application Development
Environment — Getting Started


Dynamic Buffer/Temp Table Module

Progress puts the records that it reads into a buffer. Once a record is in the buffer, its fields are available to your application. Before Progress Version 9, you set the table for that buffer at compile time and could not change it at run time. Progress Version 9 introduced new language elements that enable you to build dynamic buffers. With a dynamic buffer, you can select the table for your buffer at run time. The buffer fields enable you to select the fields to be displayed.

Choose the Dynamic Buffer/Temp Table button on the SportsPro main window to launch this module:

This module demonstrates a non-SmartObject approach to separating the user interface and business logic portions of an application. The initializeObject procedure runs a procedure on the AppServer partition that populates the list of database tables. Choosing the Open Query button runs another procedure on the AppServer partition. That procedure populates a dynamic temp table and passes back the handle for that temp table.

Table 2–4 describes the major objects used in the Dynamic Buffer/Temp Table module.

Table 2–4: Components Of the Dynamic Buffer/Temp Table Module
Object Or File Name
Object Type
Function
wquery.w
SmartWindow
Serves as a container for the other objects in the module.
gettablefields.p
Procedure file
Runs during the initializeObject internal procedure to populate the selecttable selection list.
selecttable
Selection-list
Lists the available tables.
getnewfields.p
Procedure file
Runs when a table is selected to populate the selectfld selection list.
selectfld
Selection-list
Lists the available fields in the selected table.
btnadd
Button
Adds the field selected in the selectfld selection list to the selectfld2 selection list through the additem internal procedure.
btnremove
Button
Removes the selected field from the selectfld2 selection list through the removeitem internal procedure.
selectfld2
Selection-list
Lists the fields that will be displayed when the query runs.
btnopenqry
Button
Runs getrecords.p and receives the handle of the dynamic temp-table that procedure creates. It then runs the displayflds internal procedure to populate EDITOR–1.
getrecords.p
Procedure file
Creates a dynamic temp-table and populates it based on the fields listed in the selectfld2 selection list.
EDITOR–1
Editor
Displays a single record from the dynamic temp-table.
btnfirst
Button
Navigates to the first row of the result set.
btnnext
Button
Navigates to the next row of the result set.
btnprev
Button
Navigates to the previous row of the result set.
btnlast
Button
Navigates to the last row of the result set.

For more information on building dynamic buffers and temp tables, see the chapters on temporary tables and on using dynamic widgets in the Progress Programming Handbook .


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