Search columns
- Last Updated: April 11, 2024
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
There are also two events that let you interact with search mode. START-SEARCH
occurs when the user chooses a column label. END-SEARCH occurs when the
user enters edit mode on a cell or selects a row. You can apply both of these events to
columns to force the start and end of search mode.
When a read-only browse has focus, typing any printable key (an alphanumeric character) forces the AVM to reposition the browse to the first row where the first character of the first browse column matches the typed character. Thus, the read-only browse allows searching, but based only on the data in the first column. If the browse finds no match, it wraps to the top of the column and continues searching.
In an updateable browse, the user can select the column that is to be the basis of the character search. First, the user clicks a column label. The column label depresses. When the user types any printable key, the AVM searches for the first row in that column that matches and focuses that row. Column searches also wrap to the top if necessary.
INDEXED-REPOSITION option does not wrap to the top of the column if
it cannot find a record to satisfy the search. This behavior is a side effect of the
reposition optimization. To work around this, you can apply HOME to the
query before starting the search.There are two ways to extend this basic behavior:
- You can configure an updateable browse to look like a read-only browse. This technique gives you selectable columns and searching on those columns even when you do not want to allow rows in the browse to be modified.
- You can use the
START-SEARCHandEND-SEARCHbrowse events to trap the beginning and end of search mode and write to your own search routines.
As noted, the column-searching feature is exclusive to the updateable browse. The
read-only browse can do one-character deep searches on the initial column of the browse.
You can work around this by defining your browse with one field enabled for input and
the NO-ROW-MARKERS option specified. After the definition, disable the
enabled column by setting the column’s READ-ONLY attribute to false.
This provides an updateable browse that looks like a read-only browse. The updateable
browse retains the ability for the user to select individual columns and perform
searches on them.