Transcript Chapter 1

Advanced Forms Builder Topics
Chapter 10
A Guide to Oracle9i
1
Objectives
• Learn about form items that display boilerplate items,
calculated data, and images
• Create forms that allow users to load and display
image data
• Create form lists that display static data values
• Learn how to configure forms that retrieve and
manipulate large data sets
• Understand how to control data block relationships
A Guide to Oracle9i
2
Creating Non-Input Form Items
• Most form items (text items, radio groups,
check boxes, and so forth) allow users to
input and change data values
• Forms Builder also supports a number of
items that display data but do not allow the
user to change the displayed value
A Guide to Oracle9i
3
Creating Non-Input Form Items
A Guide to Oracle9i
4
Creating Non-Input Form Items
• Display items: display text data that the user
cannot modify; can also display calculated
values based on form data values
• Boilerplate objects (text and shapes) placed
on top of other boilerplate objects, appear in
the order in which you create them
A Guide to Oracle9i
5
Creating Non-Input Form Items
• Following data block form displays data from
the Clearwater Traders INVENTORY
database table
• Display items on this form include:
– One that shows value for each inventory item,
calculated as price times quantity on hand
– Summary display item sums values of all retrieved
items
– Boilerplate rectangle and text label describe and
emphasize the summary display item
A Guide to Oracle9i
6
Creating Non-Input Form Items
A Guide to Oracle9i
7
Creating a Form to Load and Display
Graphic Images
• Display graphic image on form as static imported
image, which incorporates image data into form
design (.fmb) file and compiles it into .fmx file, or as a
dynamic image, which loads image data from
workstation file system into form at runtime
• Use static imported images to add graphic
enhancements that stay the same regardless of data
that currently appears on form
A Guide to Oracle9i
8
Creating a Form to Load and Display
Graphic Images
• Use dynamic images to display images retrieved from
database or file system while form is running, or to
retrieve and display large static images that do not
appear every time you run form
• To create a form that loads and displays dynamic
images that the database stores, base form on table
that contains data field with BLOB data type
• To load images into database, create form trigger that
uses READ_IMAGE_FILE built-in to load the image
into form image item
A Guide to Oracle9i
9
Creating a Form to Load and Display
Graphic Images
A Guide to Oracle9i
10
Creating the Data Block and Layout
• Use the Data Block and Layout Wizards to create the
data block and layout for the ITEM table fields
• Recall that the ITEM table has a field named
ITEM_IMAGE that is a BLOB (binary large object)
data type, and that this field currently contains a
locator for the BLOB image
A Guide to Oracle9i
11
Creating the Data Block and Layout
A Guide to Oracle9i
12
Creating Static Lists in Forms
• A list item is a data block item that displays a static
list from which users can select to provide form inputs
• Use a form list item when the user can select from a
limited number of choices that do not change very
often
• Use lists instead of radio buttons when there are
more than five choices or when there is a limited
amount of space on the form to display radio buttons
A Guide to Oracle9i
13
Three Types of Static List Items
• Poplist: drop-down list that user opens when
needed. When user opens list, drop-down box
displays up to 10 items at once
• T-List: also called Text List, always displays the
current selection. It has up and down scroll arrows on
right edge, and user can use these arrows to scroll
through list items sequentially and select different
values
• Combo box: Poplist in which user can enter value if
desired value does not appear in list
A Guide to Oracle9i
14
Creating Static Lists in Forms
A Guide to Oracle9i
15
Creating Static Lists In Forms
A Guide to Oracle9i
16
Creating Static Lists in Forms
A Guide to Oracle9i
17
Creating Static Lists in Forms
A Guide to Oracle9i
18
Using Forms with Large Data Sets
• Form developers need to estimate the
maximum number of records that form
queries might retrieve, and then design their
form applications to ensure that form
performance remains satisfactory
A Guide to Oracle9i
19
Using Forms with Large Data Sets
• Approaches for improving form data retrieval
performance include
– creating indexes on search fields
– training users to count query hits
– forcing users to enter search conditions in forms
that might retrieve large data sets
– configuring LOVs to allow users to filter data
A Guide to Oracle9i
20
Improving Form Data Retrieval
A Guide to Oracle9i
21
Improving Form Data Retrieval
A Guide to Oracle9i
22
Improving Form Data Retrieval
A Guide to Oracle9i
23
Improving Form Data Retrieval
A Guide to Oracle9i
24
Controlling Data Block Master-Detail
Relationships
• In a master-detail form, master block and detail block
are coordinated
• Master record and detail record are associated by a
relationship
• coordination-causing event: any operation that
causes current record in master block to change,
• When user performs a coordination-causing event,
detail block values also change
A Guide to Oracle9i
25
Controlling Data Block Master-Detail
Relationships
A Guide to Oracle9i
26
Controlling Data Block Master-Detail
Relationships
• When you use the Data Block Wizard to
create a form that displays a master-detail
relationship between two blocks, Forms
Builder automatically
– creates a relation object in the master block
– creates several triggers and PL/SQL program
units that enforce coordination between the form
master and detail blocks
A Guide to Oracle9i
27
Controlling Data Block Master-Detail
Relationships
• The relation object specifies properties about
the relationship:
– name of the detail block
– SQL join condition that specifies the relationship
between the master block and the detail block and
how the form handles deletions of master block
records
A Guide to Oracle9i
28
Controlling Data Block Master-Detail
Relationships
A Guide to Oracle9i
29
Relation Triggers and Program Units
A Guide to Oracle9i
30
Controlling Data Block Master-Detail
Relationships
• Relation’s Delete Record Behavior property specifies
how deleting a record in master block affects records
in detail block
• Possible values:
– Non Isolated: prevents user from deleting master record
when associated detail records exist in database
– Isolated: allows user to delete master record when
associated detail records exist
– Cascading: performs cascading delete; form deletes the
master record, then deletes all associated detail records in
detail block’s base table
A Guide to Oracle9i
31
Controlling Data Block Master-Detail
Relationships
• A relation’s Prevent Masterless Operations
property specifies whether users can query or
insert detail block records when there is no
master record in the master block
A Guide to Oracle9i
32
Controlling Data Block Master-Detail
Relationships
• A relation’s Deferred and Automatic Query
properties work together to determine
whether the detail block records automatically
change when the user selects a new master
record, or if the user has to navigate explicitly
to the detail block and refresh the detail
records
A Guide to Oracle9i
33
Relation Triggers and Program Units
These program units are called by the relation-handling
triggers or by one another, and handle the details of the
master-detail processing
A Guide to Oracle9i
34
Relation Triggers and Program Units
A Guide to Oracle9i
35
Changing Relation Properties
Dynamically
• User can specify retrieval properties of a
relation while form is running
• Use the SET_RELATION_PROPERTY builtin, which has the following syntax:
SET_RELATION_PROPERTY('relation_name',
property, value);
A Guide to Oracle9i
36
Changing Relation Properties
Dynamically
A Guide to Oracle9i
37
Changing Relation Properties
Dynamically
A Guide to Oracle9i
38
Summary
• Creating Non-input form items
– Display items
• Creating forms to load and display graphic images
• Creating the data block and layout
• Creating static lists
– Types of static lists
• Using forms with large data sets
– Improving form data retrieval
• Controlling data block master-detail relationships
– Relation triggers and program units
• Changing relation properties dynamically
A Guide to Oracle9i
39