Pattern 8: Convert Lookup Page to Dropdown List |
This pattern lets you change the lookup behavior on a foreign key field. Instead of having to "step out" to a separate lookup page, the user is invited to select a parent value from a dropdown list. This is only appropriate if you have a limited number of possible parent values and if the user does not need full search-and-select facilities to choose the right parent value. On a foreign key field, to convert lookup behavior from "step-out lookup page" to dropdown list:
Resetting the Lookup Method relationship attribute as described in Step 1 causes Web Designer to: •Use a different default value for the Type property of the foreign key field(s). If the field is in a single-record block, this property is of the Data child object of the field's TextColumnControl. If the field is in a multi-record blok, this property is of the GridCellControl. With a "step-out lookup page", this property has the value "text". With a dropdown list, it has the value "select". •Add a DataSourceDropDown data source that provides the data from which the user can choose in the dropdown list. This data source takes over the role of the data source in the lookup page that is now no longer used. This step-by-step scenario causes ALL foreign key fields based on the relationship to take on the new lookup behavior. To convert the lookup behavior for an individual foreign key field in an individual page class, instead of changing the relationship attribute, you must manually: •Reset the Type property of the Data child object for the field. •Add an extra data source to the page class. Do this by dragging (onto the Page node of the object tree) a "Lookup..." data source object from the Controls tab of the catalog for the appropriate parent table. Set its Initial State property to Query Records and its "Maximum number of records" property to 0.
See Also Page and Data Source Constructs
|