How to takes drop-down items value from database connected in Progress 4gl, Open Edge?
-
21-04-2021 - |
Question
I have created one simple window with one drop down box and the project already connected with default sports database. now i want to show all the tables in database in that drop down box.
Solution
To be able to dynamically fill the contents of a combo-box, you need to dynamically create it:
DEFINE VARIABLE ComboBoxWidgetHandle AS HANDLE NO-UNDO.
CREATE COMBO-BOX ComboBoxWidgetHandle.
After that, you can use the widget handle to add elements to the combo-box, by using the database metaschema table called '_file':
FOR EACH _file NO-LOCK WHERE _Hidden = NO:
ComboBoxWidgetHandle:ADD-FIRST (_file._FILE-NAME).
END.
If you also want to know the other properties of the _file metaschema table, just try a
FOR EACH _file NO-LOCK WHERE _Hidden = NO:
DISPLAY _file.
END.
and you'll get an overview over that metaschema table.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow