Pattern 7: Customized Lookup Page

Previous Next

From every field in a web page that corresponds to a foreign key in the data model, USoft automatically offers a lookup button that lets the user temporarily "step out" to a lookup page where he can search-and-select a value. When he returns to the page with the foreign key field, the selected value is written into that field.

The main page is based on a child table, for example, RESERVATION, and the lookup page is based on a parent table, for example, SCHEDULED_TOUR.

It is easy to imagine that you want to customize the lookup page. In this design pattern, you replace the search facility in the lookup page by an automatic query.

To replace the search facility in a lookup page by an automatic query:

1.In the Web Designer catalog, identify the default info page class that corresponds to the child table, for example, Reservations. Create a subclass and rename this subclass to some appropriate name, for example, MyReservations.
2.In the Web Designer catalog, identify the default lookup page that corresponds to the parent table and to the parent-child relationship that your lookup is based on, for example, "Scheduled Tours for which are made Reservations". Create a subclass and rename this subclass to some appropriate name, for example, MySchedtourLookup.
3.Open the MyReservations page class and, in the object tree, identify the TableColumn object that corresponds to the foreign key, for example, the SCHEDTOUR_ID child object of the RESERVATION data source object. Open the Property Inspector for this TableColumn object and set its Lookup Page property to MySchedtourLookup.
4.Open the MySchedtourLookup page class. In the object tree, delete the SearchGroup. Open the Property Inspector for the main data source, for example, SCHEDTOUR, and set its Initial State property to "Query Records".
5.Save work, then re-publish the MyReservations page class and the MySchedtourLookup page class.

 

NOTE: More involved forms of lookup customization include basing the lookup on a Logical View. In such cases, it may not be sufficient to simply point to a different lookup class (as you did in Step 3). For more involved customizations, you need to know that:

Data synchronization between the lookup page and the caller page is determined by the value of the Synchronization DataSource property of the Lookup object contained in the lookup page's data source.

Mappings between fields in the lookup page and fields in the caller page are determined by property values of LookupColumn child objects of this Lookup object.

 

See Also

Page and Data Source Constructs