How to Call a Lookup Dialog |
Lookup windows are called from query columns that are defined as a foreign key in a relationship. By default they are called from Info Windows. However, they may be called also from dialogs that have inserted text boxes: "lookup dialogs". This example shows how to create lookup functionality in a dialog. If the user wants to use the lookup facility, she presses the lookup button and gets a default USoft lookup window on the Product table. She finds a possible Product value in this window and clicks some button to select it (OK, Apply ...). The selected value is copied into the calling dialog. This construct offers maximum re-use of the default USoft lookup functionality, but at the same time offers all the flexibility of a manually painted dialog. To call a lookup window from a field in a lookup dialog:
<LOOKUP_TABLE>.<LOOKUP_COLUMN> using capitals, e.g.: PRODUCT.NAME
Variables.Text_Box_1.Text_Box
Variables.Text_Box_1.TextBox.WindowCreateLookupDialog(<Lookup Window class name>)
The lookup window does not support function keys such as F2 and F3, but it will take on the icon toolbar from the Lookup Dialog style sheet class. For ease of design and maintenance, start by creating a special lookup dialog subclass. |