Create and use dynamic browses
- Last Updated: May 8, 2024
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Especially when you start using dynamic temp-tables and defining their fields at run time, you will want to be able to define dynamic browse objects to display their contents. You can also use a dynamic browse if you have a dynamic query on a database table that is not known until run time, or anytime the column list of the browse needs to be definable at run time.
Much like a dynamic temp-table, you define a dynamic browse in stages, first defining the browse object itself with the CREATE BROWSE statement, and then adding columns to it in separate statements.
At run time, you can also add columns to a static browse control and define the query for a static browse.
You create the browse with this statement:
|
As with other dynamic objects, if you do not assign a value to the attributes in the
CREATE statement you can set them later on using the browse
handle.
Attributes you can set for a dynamic browse include:
XandY, orCOLUMNandROW— The position of the browse.WIDTH— The width of the browse in characters.DOWN— The number of rows to display in the browse viewport.TITLE— A title for the browse object.FRAME— The handle of the frame to parent the browse to.QUERY— The handle of the associated query for the browse.SENSITIVE— Set to true to enable the browse. Note that this attribute enables only the browse object itself, allowing the user to scroll and otherwise manipulate the browse. You enable individual browse columns separately.VISIBLEorHIDDEN— SetVISIBLEto true to force the browse to be viewed. SetHIDDENto false to make sure the browse is viewed when its container is viewed.READ-ONLY— Set to true to make all columns read-only. Set to false to allow individual columns to be enabled.SEPARATORS— Set to true to get lines between the browse columns.ROW-MARKERS— Set to true to have row markers at the beginning of each row, or false to remove them.
For the full list of attributes and methods see BROWSE widget in the ABL Reference.
You must set a browse’s query handle before you can add columns to the browse, and you must parent it to a frame before you can visualize it.
A dynamic browse always has the NO-ASSIGN quality, meaning that the AVM
is not able to automatically save changes you make to enabled columns in the browse.
This is because the browse is completely defined at run time, and the AVM cannot
anticipate and supply default behavior for column assignment at compile time. However,
in a distributed application you would never make direct changes to a database table
from a browse anyway, so the utility of the static browse that can do auto-assignment of
changes is very limited.