Progress
Programming
Handbook
Browse Events
This section covers:
Basic Events
The basic browse events include:
- VALUE–CHANGED event occurs each time the user selects or deselects a row.
- HOME event repositions the browse to the beginning query list.
- END event repositions the browse to the end of the query list.
- DEFAULT–ACTION event occurs when you press
RETURN
orENTER
or when you double-click a row. DEFAULT–ACTION also has the side effect of selecting the row that is currently highlighted.- The SCROLL–NOTIFY event occurs when the user adjusts the scrollbar.
Typically, you use the VALUE–CHANGED and DEFAULT–ACTION events to link your browse to other parts of your application, in the code example below, both events are used to handle displaying data that is not ideally suited for display in the browse. In this case, a supplemental editor widget is used to display the lengthy text strings found in the customer comments field.
The trigger on VALUE–CHANGED refreshes the data in the comments editor as you navigate through the browse. This type of trigger is often used to keep related data in the same frame or window in sync with a browse.
The trigger on DEFAULT–ACTION displays the comments editor in a dialog box that pops up when you double-click a browse row. One typical use of DEFAULT–ACTION triggers is to display a supplementary view of data related to the record, as the following code sample demonstrates:
The following screen shows both ways that the comments field is handled in this example:
![]()
One use for the HOME and END events might be to force the results list to be built in a particular direction when working with INDEXED–REPOSITION queries.
The SCROLL–NOTIFY event is important if you plan to overlay other widgets on browse cells. SCROLL–NOTIFY gives you the ability to move the overlay widget to keep pace with the user’s scrolling. See the "Overlaying Widgets on Browse Cells" section later in this chapter for more information on this technique.
Row Events
The browse supports three row-specific events:
You can find examples of how ROW–ENTRY and ROW–LEAVE work in the "Updating Browse Rows" and "Creating Browse Rows" sections later in the chapter.
The ROW–DISPLAY event lets you change color and font attributes of a row or individual cells or to reference field values in the row. On Windows, the ROW–DISPLAY event lets you change the format of a browse-cell (by changing the value of its FORMAT attribute). The ROW–DISPLAY event cannot be used for any other purpose.
For example, you might want color overdue accounts in red. This kind of cell manipulation is only valid while the cell is in the viewport. For this reason, you need to use ROW–DISPLAY to check each new row as it scrolls into the viewport. The code fragment below shows a sample trigger:
NOTES:Column Events
The LEAVE and ENTRY events reference the entire browse widget. For example:
You can also write triggers for column names. You can use these triggers to change an attribute of the entire column (change a column background color), or to modify a single cell in that column. The affected cell is the named column in the focused row. For example:
There are also two events that allow you to 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. See the "Searching Columns (Windows Only)" section earlier in this chapter for more information on these events. Note that both of these events can be applied to columns to force the start and end of search mode.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |