![]() | Getting Started-2-Tier | ![]() |
Selection screens are available for the GUI interface, but not for web applications.
In Lesson 4, you created a master-detail screen that joined two tables: distributors and orders. In this lesson, you create another master-detail screen that joins the orders table as the primary master table to the order_items table. In addition to columns from the order_items table, the screen's detail section also includes data from the titles table. Thus, it can display the titles of the videos.
Because the screen's detail section contains multiple tables, the screen wizard:
In this lesson you learn how to:
When you use the screen wizard, the first table you select for a section—master, detail, or subdetail—is considered the first (primary) table view for that section. For the screen you create here, select orders as the first master table and join it to order_items as the first detail table.
New
Screen or
.
The New Screen Tool dialog opens.
The Format Selection dialog opens.
The First Master dialog opens.
orders from the list of Tables To Pick From.
.
This specifies to include all columns in the orders table on the completed screen.
The First Detail dialog opens.
order_items from the list of tables.price in the list of columns in order_items.
The selected columns are added to the list of those already chosen.
The screen wizard lets you include information from other database tables in the same section, as long as the corresponding repository screens specify links to the section's first table. By selecting the titles tables in addition to the order_items table, the screen's detail section can display the name, number of available copies, and standard unit price of each video, along with the price and quantity data from order_items. The screen wizard includes links that define the relationship between order_items and titles.
The Additional Detail dialog opens and shows which tables can be joined to the order_items table.
titles from the list of tables.
The list of columns belonging to the titles table displays.
name, order_price, and quantity_avail.
The Layout Selection dialog opens.
The Style and Finish dialog opens.
When you include columns from additional tables, the screen wizard lets you decide whether to generate selection screens. The usefulness of selection screens depends on the client screen's function. For example, a data entry screen might make good use of a selection screen, while a display-only client screen probably would not.
More About Selection Screens
When the Generate Selection Screens check box is selected, the screen wizard automatically creates a selection screen for every additional table that you include on your client screen.
Selection screens, sometimes called pick lists, are useful when a user is adding a new record to the database. The selection screen displays a list of acceptable values for a field when the user requests help.
Order Item Detail and choose Done.
A preview of the client screen displays:
When the wizard finishes building the screens (notice the status bar), the results include two screens:
Save the screens to client.lib.
The Save Screen dialog opens.
orditm.scr in library client.lib.titles.itm to client.lib. You can close the screen after saving.Now test the screens.
orditm.scr .
Test Mode or
.
The Order Item Detail screen opens.
.
The first record in the orders table displays. Several order_item records are associated with this order. They are displayed in the grid.
Title_id field of the first empty row in the grid.
The Titles Selection screen opens and displays all video records in the titles database table.
Cinema Paradiso and double-click on the ID to select that video.
The selection screen closes and the record you selected appears in the grid on the Order Item Detail screen. The cursor advances to the next data entry field in the grid (qty).
3 in the Qty column.
Add another item to this order, but this time, enter the title identification number. Panther uses a validation routine to ensure that the entry is valid.
TAB to advance to the next empty row and type 55 in the Title_id column. Press Enter or TAB.
Willie Wonka and the Chocolate Factory is the name of the video associated with the specified ID number.
.
This action saves the new items to the selected distributor's order.
You created an order entry screen that provides an easy way to add items to an order. You did this by performing these tasks:
You learned:
What did you learn?