Lookup wizard is a list of values. Values can be entered manually (List of values option) or retrieved from the database table (Database table option).
Use add/delete buttons to add/delete values and up/down buttons to order them.
You can select the existing database table/custom view to retrieve values from (Table dropdown box) or create new custom view using Create new query button. For more information about creating SQL query, see About SQL query designer.
Note: if selected table is included in the project, the rules applied to the project tables (such as modified SQL query, Advanced Security, сhanges made to the SQLQuery object in the After table initialized event) will be also applied to the lookup table. For example, you can limit the list of items in dropdown with Advanced Security.
You can use Custom Expression for the Display field to display several values from different fields with custom design in dropdown box. Click the arrow near Display field and then <Custom expression>.
How it looks in browser:
The WHERE expression allows to sort dropdown box content. In our example if you put "phone like '%555%'" into WHERE box only Contacts with 555 in phone number will be displayed.
To use table variables of the session in a WHERE clause, table names should be written as follows:
You can use SQL variables in a WHERE expression:
See more examples of SQL variables
You can auto-fill several fields on the Add/Edit pages with values from the lookup table.
Add new items on the fly
This option puts Add new link next to dropdown box allowing to add new items right on Edit/Add page. Add new item popup is a fully-featured add page.
You can use dependent dropdown lists, where values shown in the second dropdown list depend on the value you’ve chosen in the first one.
Let's make the Model field content depends on the Make field value:
1. Set Lookup wizard as "Edit as" type for the Make and Model fields.
2. For the Model field select This dropdown is dependent on check box. Select Make as parent field from the main table and filter field from lookup table.
3. Click Test it to check how it works.
An example of Edit page with dependent dropdown lists:
Cascading dropdown lists
You can also create chain of dependent dropdown lists where one dropdown list depends on two or more master dropdown controls. For example, Model field content depends on values of Make and YearOfMake fields. So you can select from only those models that were produced by selected company on selected year. To perform this:
1. Set Lookup wizard as "Edit as" type for the Make, YearOfMake and Model fields.
2. Make the YearOfMake dropdown list depends on Make dropdown list.
3. For the Model field select This dropdown is dependent on check box and click Advanced. Then select Make and YearOfMake fields and click OK.
Click Test it to check how it works.
Also more than one dependent dropdown box can be tied to the same master dropdown control.
List of values is displayed as a dropdown box. If you set Multiline to any value greater then one this field will appear as a listbox on Add/Edit pages. Select Allow multiple selection check box to allow users select multiple values.
Edit box with AJAX popup
This feature is explained in AJAX-based features. Select Allow multiple selection check box to allow users select multiple values.
The application will look for the occurrence of the typed in string anywhere in the list. For example, when you enter 'co', it will show 'Corolla' and 'Accord'. If you want to change this behavior and make it look for the values starting with the entered value, i.e. 'Corolla' only, add the following code to the AfterAppInit:
List of values is displayed as set of check boxes. A user can select one or several values.
If you enable Horizontal layout check box, check boxes will be placed horizontally.
List of values is displayed as set of radio buttons. A user can select only one value.
If you enable Horizontal layout check box, radio buttons will be placed horizontally.
List page with search
Once Select button is clicked user is presented with the searchable lookup table. Lookup table appearance is fully customizable in Visual Editor. Select Allow multiple selection check box to allow users select multiple values.