Progress
Programming
Handbook
Creating Dynamic Browse Columns
The dynamic browse that you create with the CREATE BROWSE statement is an empty browse. You must add the browse columns using the following methods:
ADD–COLUMNS–FROM( ) Method
The ADD–COLUMNS–FROM( ) method creates a browse column for every field in the specified table or buffer except for any fields specified in an except-list. The specified table or buffer must be in the associated query. Use this method when you want the browse to contain all or most of the fields in a table or buffer.
The following program creates a browse which displays all the fields in the customer table except for terms and comments:
ADD–LIKE–COLUMN( ) Method
The ADD–LIKE–COLUMN method creates a single browse column from the specified field name or buffer field handle. You can also define the position of this column within the browse. The specified field must be a field in one of the buffers of the associated query. Use this method when you want the browse to contain only a few fields in a table or buffer.
The following program creates a browse containing only four fields from the customer table:
For other examples of the ADD–LIKE–COLUMN( ) method, see the program, p-fnlqry.p, in section "Dynamic Query Code Example."
ADD–CALC–COLUMN( ) Method
The ADD–CALC–COLUMN( ) method creates a single browse column with the specified properties rather than from a table or buffer field. This is typically used as a placeholder column for a calculated value.
The following program creates a browse containing four fields from the customer table plus a fifth field containing the calculated current credit limit:
Notes on Dynamic Browse Columns
- You cannot specify the CAN–FIND function in the validation expression for a dynamic browse-column. Since Progress compiles validation expressions at runtime for dynamic browse-columns, CAN–FIND produces an error and the validation will not run for that column. You can still use the CAN–FIND function for a static-browse column.
- You can set the VISIBLE attribute for a browse-column as well as a browse.
- You can change the SCREEN–VALUE attribute for a browse-column within the browse’s ROW–DISPLAY trigger as well as outside the trigger.
- You must define the ROW–DISPLAY trigger where the value of the calculated column is set prior to using the ADD–CALC–COLUMN( ) method so that the trigger is already set before the column is added. This is to ensure that the initial viewport of the calculated column is populated.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |