Enable columns in the browse
- Last Updated: April 12, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
In this section, you experiment with browse columns.
To enable some of the columns in the OrderLine browse:
- Add this
ENABLEphrase to the browse definition:DEFINE BROWSE OlineBrowse QUERY OlineQuery NO-LOCK DISPLAY ttOline.Ordernum . . . ENABLE ttOline.Price ttOline.Qty ttOline.Discount WITH SEPARATORS 7 DOWN ROW-HEIGHT-CHARS .57. - You can also remove the
NO-ROW-MARKERSkeyword to see the effect of row markers in your updateable browse:
Now that the browse is updateable there is a row marker at the beginning of each row, if
you do not specify the NO-ROW-MARKERS keyword, to indicate which row is
selected. This is useful because the way a row is highlighted is very different
depending on whether the user happens to click in an enabled or read-only column:
- If the user selects a row by clicking on a column that is not enabled, the entire row is highlighted to indicate the selection (as in the first row of the Order browse above), just as if the browse had no enabled columns.
- If the user selects a row by clicking on an enabled column, then that cell is highlighted and a cursor appears in it to let the user change its value, as in the selected row of the OrderLine browse above.
The user should always click on the row marker to select a row to avoid inadvertently selecting an enabled column when this is not the user’s intent.
If the user selects the Price column for an
OrderLine, or the Qty or
Discount, which are all enabled, the browse cell for that
column behaves in much the same manner as a fill-in field. Tabbing or clicking moves the
user from one updateable cell to the next. If the user changes the value, then that
value is assigned when the user leaves the row. But assigned where? Because this is a
browse of a temp-table, the value is assigned only back to the row in the temp-table. If
the user browses an actual database table, then the update goes back to the database
unless you included the NO-ASSIGN keyword in your browse definition.
You learn more about updating records in Update Your Database and Write Triggers.
CURSOR-DOWN and CURSOR-UP. Character row markers
appear as an asterisk (*). Also, the EDITOR-TAB and
BACK-TAB key functions (usually CTRL+G and
CTRL+U) tab from cell to cell.One very important fact to remember is that you cannot enable, or turn on, a read-only
browse after you have defined it. If you expect to need any of the capabilities of the
updateable browser, enable the appropriate fields in the definition and then use the
READ-ONLY logical attribute to temporarily turn them off at run
time.