Kbase P59676: SET-SELECTION does not select the text in a browse-column be
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/16/2003 |
|
Status: Unverified
SYMPTOM(s):
Calling the SET-SELECTION method on a browse cell.
Focus is currently placed on the browse cell.
SET-SELECTION method is being called from the cell's ENTRY trigger.
e.g.:
ON ENTRY OF Customer.Name IN BROWSE BROWSE-1 /* Name */
DO:
Customer.Name:SET-SELECTION(2,4) IN BROWSE {&BROWSE-NAME}.
END.
SET-SELECTION does not highlight the text in the browse column between the two specified character offsets. Instead, the entire text on the cell is selected.
CAUSE:
What is happening here is that the selection gets set but when the trigger ends the default behavior for the ENTRY event occurs. The default behavior for ENTRY is to select all of the text.
FIX:
The following two lines of code need to be added to the trigger in order to get this working:
ON ENTRY OF Customer.Name IN BROWSE BROWSE-1 /* Name */
DO:
==> APPLY "ENTRY" TO SELF.
Customer.Name:SET-SELECTION(2,4) IN BROWSE {&BROWSE-NAME}.
==> RETURN NO-APPLY.
END.
By adding these lines you stop the default behavior from happening. It looks very strange, but it makes sense. You couldn't just do RETURN NO-APPLY to stop the default ENTRY behavior, because that would also cause focus to go to the next cell. So you have to APPLY ENTRY TO SELF to keep focus in the cell after the trigger ends.