Consultor Eletrônico



Kbase P38946: How to catch that the selection has changed in a multiple se
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/10/2003
Status: Unverified

GOAL:

How to catch that the selection has changed in a multiple selection browse?

GOAL:

There is no SELECTION-CHANGED event for a multiple selection browse.

FIX:

At the time of writing (Progress 9.1D06), there no SELECTION-CHANGED event for a multiple selection browse, but an enhancement request has been reported to implement such an event.


The VALUE-CHANGED event is not reliable to catch this situation because it fires only when moving the focused-row (with focused row being selected), as illustrated here:
1) Row 4 focused and selected
2) With mouse, select from Row 1 to Row 4
 => Since Row 4 was already the focussed row, then VALUE-CHANGE event does not fire, which is the expected behavior.


For now, the only possible work around to find out if the selection has changed is to:

A] Rely on the LEFT-MOUSE-UP trigger to catch selection made with the mouse

B] Rely on the space Key event trigger to catch selection made with the keyboard.  Note that the AppBuilder does not let you define the ' ' trigger like other triggers.  Therefore you have to manually type the following in the Main block of your .w file to define it:
 ON ' ':U OF MyBrowse RUN ManageBrowseSelectionChanged IN THIS-PROCEDURE.


C] Check if the selection has change by comparing the current selection with
the content of a temp-table having one record per selected row (ROWID of the temp-table)

To sweep the selection, you might use
DO n = 1 TO Browse:NUM-SELECTED-ROWS:
   Browse:FETCH-SELECTED-ROW(n).

Note you have to check if each selected row has a record in the temp-table, and if each record in the temp-table really corresponds to a selected row


D] The ttSelectedRow temp-table will have to be maintained each time the selection is changed (row added or removed)

E] The ttSelectedRow temp-table will have to be emptied each time that the query of the browse is reopened.