Previous | Table of Contents | Next

Page 346

Figure 12.21.
Setting an item's type.

NOTE
If an item property has a pre-defined set of values, you can change the value of the selected property by repeatedly pressing Enter or by clicking the mouse. The property has a pre-defined set of values if there is a pop-up list to the right of the field at the top of the Properties window.

Control Block Items

To see the difference between a base table block item and a control block item, look at the properties of the Save item in the BUTTON_PALETTE control block. First, notice that the item type is Button (see Figure 12.22). Also, unlike a base table block item, a control block item doesn't have any properties related to the database.

Of course, given that the Save item is a button, the button must perform some action when it's activated. If you expand the Save item in the Object Navigator, you will see that a trigger, named WHEN-BUTTON-PRESSED, belongs to the item. Many control block items are buttons that "control" the behavior of other blocks in a form.

Page 347

Figure 12.22.
Viewing a control
block item type.

Canvas-Views

The canvas is a background object on which block items are placed. Each canvas has a view that defines how the canvas is viewed through a window. You can manipulate the items on the canvas with the Layout Editor. Select the Canvas-View that you want to change and
right-click Layout Editor. When you create a new block, the Forms Designer creates a Canvas-View if one doesn't already exist and places the block items on it. Figure 12.23 shows the default layout for the Student form.

Windows

A window is an empty frame that "sits" on the Canvas-View. Every form has at least one window but may contain more. Figure 12.24 displays the Properties window for the default window, WINDOW0, which was created when the Student block was created. Some of the properties that are typically modified include the width, height, and title.

Triggers

A trigger is one or more PL/SQL statements that are executed when some action occurs that causes the trigger to fire. A trigger can be associated with many different levels of a form's object hierarchy. For instance, you can define a trigger that fires when a form is activated. You can define a trigger before a query is executed in a block. Or you can define a trigger that fires when the contents of an item changes. There are many pre-defined trigger events. Figure 12.25 displays the list of trigger events that are displayed if you select the pop-up list for the trigger Name property.

Page 348

Figure 12.23.
Looking at a Canvas-
View with the Layout
Editor.

Figure 12.24.
Viewing the window
properties.

Page 349

Figure 12.25.
Trigger events.

Record Groups

A record group is a set of values that can be defined:

For example, suppose you want to create a record group based on the existing student IDs in the Student table. To do this, use the Object Navigator to select the Record Groups node in the STUDENT form, and click + in the vertical toolbar on the left-hand side of the window. A dialog window will be displayed in which you can enter the query that the new record group will be based on (see Figure 12.26).

After you enter the query and click OK, the record group is created. A record group is typically used by a List of Values (LOV).

LOVs

A List of Values (LOV) is an object based on a record group. A LOV is typically used to display a list of possible values from which a user can choose. There are several block item properties that are associated with an LOV. For example, you can indicate whether the LOV should also be used to validate the user input; that is, to ensure that the user cannot enter a value in a field

Page 350


unless that value exists in the specified LOV. You learn more about using LOVs on Day 13, "Developer/2000: Developing a User Interface with Oracle Forms," and Day 14, "Developer/2000: Application Development with Oracle Forms."

Figure 12.26.
Specifying a query for
a new record group.

Alerts

An alert is a window that's used to inform the user about an event. The window is modal—the user must select one of the buttons on the window before proceeding.

Parameters

You can define parameters for a form that can be set from another form. Using a parameter, you can create a trigger that examines the value of a parameter and, depending on its value or lack thereof, takes a specific action. Suppose you wanted to be able to invoke the Student form from another form, pass a Student ID to the Student form, and have the corresponding student's record displayed. To do this, you would define a parameter named Student_ID of type CHAR. You would also write a trigger that fired when the window was activated and, if the parameter held a value, would retrieve the record that corresponded to the student ID contained in the parameter.

Using the Registry Editor to Change Oracle Components

It's a good idea to store your runtime forms, reports, and graphics files in a directory created specifically for your application. It is a bad idea to store these files in any of the Oracle directories for a couple of reasons:

Previous | Table of Contents | Next

Используются технологии uCoz