Kbase P21600: Is it possible to view extra properties of a BROWSE widget?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/07/2003 |
|
Status: Unverified
GOAL:
Is it possible to view extra properties of a BROWSE widget?
GOAL:
How to display the database table to which the BROWSE widget is linked
GOAL:
How to display the database field to which a particular BROWSE column is linked
GOAL:
How to display the label of a particular BROWSE column
FIX:
See sample code below (run against the Sports2000 database) which gives a basic overview on how to achieve the above:
DEFINE QUERY q1 FOR customer.
DEFINE BROWSE b1 QUERY q1 DISPLAY custnum NAME
WITH 17 DOWN TITLE "Customer Browse".
DEFINE VARIABLE iNum AS INTEGER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE hCol AS HANDLE NO-UNDO.
DEFINE BUTTON BUTTON-1 NO-FOCUS
LABEL "Button 1"
SIZE 40 BY 1.91.
DEFINE FRAME f1
button-1 SKIP
b1
WITH SIDE-LABELS AT ROW 2 COLUMN 2.
DEFINE FRAME f2
WITH 1 COLUMNS AT ROW 2 COLUMN 38.
ON 'choose':U OF button-1
DO:
i = 1.
iNum = b1:NUM-COLUMNS.
DO WHILE i <= iNum:
hCol = b1:GET-BROWSE-COLUMN(i).
MESSAGE "Column Handle: " hCol SKIP
"Database Name: " hCol:DBNAME SKIP
"Tabel Name : " hCol:TABLE SKIP
"Field Name : " hCol:NAME SKIP
"Column Label : " hCol:LABEL
VIEW-AS ALERT-BOX INFO BUTTONS OK.
i = i + 1.
END. /* do while */
END. /* on choose */
OPEN QUERY q1 FOR EACH customer.
ENABLE b1 button-1 WITH FRAME f1.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.