Kbase 18663: How To Select All Rows In A Browse Widget?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/31/2009 |
|
Status: Unverified
GOAL:
How to Select All Rows in a Browse Widget?
GOAL:
Selecting all the rows of a Browse?
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
FIX:
1) Place the following code in the definitions section:
DEFINE VARIABLE logSelectAllRows AS LOGICAL NO-UNDO INITIAL False.
DEFINE VARIABLE logRC AS LOGICAL NO-UNDO.
DEFINE VARIABLE intRow AS INTEGER NO-UNDO.
2) Place the following code in whatever trigger will cause a select all to be done:
DEFINE VARIABLE intX AS INTEGER NO-UNDO.
DEFINE VARIABLE intY AS INTEGER NO-UNDO.
DEFINE VARIABLE intLastRowNum AS INTEGER NO-UNDO.
ASSIGN intY = {&QUERY-NAME}:NUM-ITERATIONS IN FRAME {&FRAME-NAME} + 1.
GET LAST {&QUERY-NAME}.
ASSIGN intLastRowNum = CURRENT-RESULT-ROW("{&QUERY-NAME}")
logSelectAllRows = True.
DO intX = 1 TO intLastRowNum BY 17: /* 17 = # Rows in ViewPort */
REPOSITION {&BROWSE-NAME} TO ROW intX.
APPLY "SCROLL-NOTIFY" TO BROWSE {&BROWSE-NAME}.
END.
ASSIGN logSelectAllRows = False.
3) Place the following code in the SCROLL-NOTIFY trigger of the browse widget:
DEFINE VARIABLE intX AS INTEGER NO-UNDO.
DEFINE VARIABLE logAnswer AS LOGICAL NO-UNDO.
IF logSelectAllRows = True THEN
DO intX = 1 TO SELF:NUM-ITERATIONS:
IF SELF:IS-ROW-SELECTED(intX) = False THEN
ASSIGN logAnswer = SELF:SELECT-ROW(intX).
END.