Getting Started-JetNet |
In this lesson, you create a master-detail client screen and its corresponding service component. The client screen will allow a user to view, edit and add information for video distributors and their video orders. The master section of the screen displays the address information associated with a single distributor, while the detail section displays information about that distributor's orders.
The screen wizard uses information you provide to also build the service component that will carry out the requests—view, update, and add.
The screen wizard creates both screens and service components by using objects and database columns from the open repository (the remote repository, data.dic for the tutorial). After the components are created, you will save them to their appropriate libraries, thereby ensuring that service requests made by the client can be carried out by the server.
In this lesson you learn how to:
To use the screen wizard, a repository that contains imported database objects must be open. The repository that you created in Lesson 6 opens automatically when you invoke the editor if the SMDICNAME
variable is set in the development environment (in Windows, prtut.ini)
or if the repository is located in the application directory, and you can skip to step 3; otherwise, you must open the repository manually (step 2).
SMDICNAME
is not set in the initialization file prtut.ini, choose FileOpenRemote Repository and select data.dic from the Open Repository dialog.Instead of creating a screen from scratch, use the screen wizard to build your screen.
More About the Screen Wizard
The screen wizard guides you step-by-step in creating database screens that automatically incorporate tables and columns imported to the repository from your database.
The screen wizard prompts you for basic design information and uses that information to build fully functional screens which you can use as-is, or as a basis for further development. The screen wizard eliminates many of the mechanical steps of screen design, thereby increasing productivity.
The New Screen Tool dialog opens.
The Format Selection dialog opens.
More About Screen Wizard Formats
When you use the screen wizard you can choose to create a Master only, Master-Detail, or Master-Detail-Subdetail screen. If you choose the Web-Friendly Output check box, the screen wizard creates a client screen that uses the appropriate layout and push button controls for a web application.
For the purpose of this module, the screen is not being designed for a Web application.
More About Web-friendly Output
The Web-friendly Output option enforces certain web-specific restrictions on the widgets and layout used in the final screen to make it usable in the Internet/Browser interface.
The First Master dialog opens.
More About Primary Keys
A primary key is the column, or combination of columns, that uniquely identifies each row in a database table. If the first table you select in a section lacks a primary key definition, the Primary Key Selection dialog opens where you can identify a primary key for the table. These custom-defined primary keys are indicated with a plus (+) sign in the list of tables that ultimately appear on your wizard-generated screen.
All columns are added to the list of columns to display on the finished screen.
All columns in the orders table are added to the list of columns to include on the screen.
More About Links
Links are widgets that are automatically created when you import database tables. They are visible in the editor and hidden at runtime. The link is used by the transaction manager to describe relationships between parent and child tables. In the editor, the link appears like a label widget, with the name of the parent table and child table in the format parent+child.
The screen wizard expects a link widget to join the first master and first detail tables. The link specifies how the two tables are connected through a list that matches columns in the first master to columns in the first detail. If you select a first detail table that lacks a link to the first master table on your screen, the screen wizard lets you define the link on the Master Detail Link dialog.
The Layout Selection dialog opens. The master table has a single-row layout and the detail section specifies a multi-row grid display. Use the default layout.
More About Screen Wizard Layout Options
You can choose the type of layout that serves the screen's immediate requirements. For each section, choose one of these layout options:
The Application Model Selection dialog box opens.
More About Two- and Three-tier Architecture
One way your choice of architecture affects your application is in the components that will be included. If you choose two-tier, the Components to Build section of the dialog box becomes inactive. This is because two-tier processing only involves building the client screens, or user interface. Three-tier processing, on the other hand, includes building client screens and their corresponding service components.
Service components are graphical representations of services, and provide a physical means of sending, receiving and processing data between a client screen and a service. A service component looks very much like its corresponding client screen, but is invisible to the user at runtime.
The Service Definition dialog box opens.
The Style and Finish dialog opens.
The Style and Finish dialog lets you can customize the screen.
Panther displays the finished screen with this prompt:
If you choose No, you return to the screen wizard's Style and Finish dialog. You can make further changes there and in previous wizard dialogs.
This is a good time to save the screens. You should save the screen in the library client.lib
.
dstord.scr
in the Member field.client.lib
as the library in which to store the screen and choose OK.
The filename is displayed in the screen's title bar. This is the screen that users of your application will see. It includes all the decorations and controls that define the user interface.
More About Naming Conventions
However you name screens, JPL modules, and other application components, you should consistently adhere to a naming convention. If you use extensions, apply them to all application components. For example, use *.scr for screens and service components, and *.jpl for library JPL modules.
dstord.scr
client screen and bring focus to the service component (Server1).
The Save Screen dialog box opens.
dstord.scr
in the Member field as the name of the service component.host!server.lib
as the library in which to store the service component and choose OK.