Transcript CH5_A
Introduction To Form
Builder
Part A
Eyad Alshareef
1
Forms
Application with a graphical user interface that
looks like a paper form
Used to insert, update, delete and view database
data
Eyad Alshareef
2
Primary Form Uses
Viewing/retrieving records
Inserting/updating/deleting records
Counting the number of records a query will
retrieve
Eyad Alshareef
3
Data Block Forms
Form associated with a specific Oracle
database table (object)
System automatically creates:
Text fields associated with table fields
Programs for inserting, modifying, deleting, and
viewing data records
Eyad Alshareef
4
Data Block Forms
ORACLE 10g forms are displayed on web
browser as a web page.
They are displayed in Forms Services
Window.
The form specification is translated into
Java Applet.
They are Dynamic Web Pages.
Eyad Alshareef
5
Displaying Forms in a Web
Browser
Developer10g displays forms as Web pages
In Web browser
Form appears in Forms Services window within
browser window
Forms Services application displays menus and
toolbar
Provide general functions for all form applications
Eyad Alshareef
6
Architecture of the World Wide
Web
Web browsers (IE, Mozilla, Foxfire)
Web servers
Web page
Static (always displays the same information )
Dynamic (the content varies based on user inputs or
data retrieved from external resources )
Forms Builder form
Dynamic Web page
Derives content from Oracle 10g database
Eyad Alshareef
7
How Forms Builder Displays a
Form in a Browser
Java applet
Self-contained Java program that runs in a web
browser generic java runtime environment
OC4J Instance
Translates compiled .fmx file into Java applet
Downloads Java applet to Web browser
Eyad Alshareef
8
Using a Data Block Form
Block
Group of related form items
Data block
Corresponds to specific database table
Contains objects that display values from table’s data
fields
Text items
Form menu
Contains selections to manipulate form
Eyad Alshareef
9
Using a form to view
table record
Eyad Alshareef
10
Form Modes
Normal
You can view records and sequentially step through
records
Enter Query
You can enter search parameters in form fields and
then retrieve the associated records
To place the form in Enter Query mode, click the
Enter Query button
Eyad Alshareef
11
Forms Services Window
Form menu contains selections that allow you
to manipulate the form
Has a toolbar with buttons to insert, view,
modify, and delete records
At bottom of the window are lines that
display information about form status
Eyad Alshareef
12
Forms Services Window
Eyad Alshareef
13
Inserting New Records
In Normal mode, click the Insert Record button
to insert a new blank record
Type the data values in the form fields
Click the Save button
to save the values in
the database
Eyad Alshareef
14
Retrieving Records
Click the Enter Query button
form in Enter Query mode
Type a search condition
Click the Execute Query button
selected records
to place the
to retrieve
If you click
, do not enter a search condition,
and then click , all table records will be retrieved
Eyad Alshareef
15
Form Search Types
Exact search: only retrieves records that exactly
match the entered search condition
Restricted search: retrieves records that fall
within a range of values
Eyad Alshareef
16
Restricted Search Operators
_: wildcard replacing a single character
%: wildcard replacing multiple characters
>, <: greater than, less than
>=, <=: greater than or equal to, less than or
equal to
<> or !=: not equal to
Eyad Alshareef
17
Scrolling Through Retrieved
Records
To view the next record, click the Next Record
button
To view the previous record, click the Previous
Record button
Eyad Alshareef
18
Updating and Deleting Records
Retrieve the record to be updated or
deleted
To update, change the data value and click the
Save button
To delete, click the Remove Record button
Eyad Alshareef
19
Closing a Form and Committing
Changes
To close a form:
Click Exit button
Click Action on the form menu and then click Exit
Close browser window
If unsaved changes exist, dialog box will prompt
to save changes
Eyad Alshareef
20
Creating Data Block
Form
Eyad Alshareef
21
Start Oracle Form Builder
Eyad Alshareef
22
Start OC4J Instance
Eyad Alshareef
23
Creating a new form
Create a new module
Create a data block
Create a layout
Eyad Alshareef
24
Data Block Form File Types
.fmb
Form design file, used by form programmer
in Form Builder
.fmx
Form executable file, run by form users
Eyad Alshareef
25
Creating a Data Block Form
When
creating a form for a table,
Forms Builder automatically creates:
Labels
Text
entry fields
Insert, update and delete and select
queries
Eyad Alshareef
26
The Object Navigator
Eyad Alshareef
27
The Object Navigator
Displays Forms Builder objects and underlying
components
As hierarchical tree
Forms Builder toolbar displays buttons
Form module
Object node
+ indicates lower-level objects
- indicates node expanded fully
Eyad Alshareef
28
Form Components
Form module: form application
Form window
Title bar on top
Horizontal and vertical scrollbars
Can be resized, maximized, minimized
Eyad Alshareef
29
Form Components
Canvas
Surface that displays form items
Block
Object that contains form items
Form items
Command buttons, radio (option) buttons, text items
Items in the same block can appear on different canvases
Eyad Alshareef
30
Form Components
Window
Canvas
Name
Block of items
Cash
Check
Credit Card
Eyad Alshareef
31
Creating a New Data Block Form
Create a new form module
Create a new data block using:
Data block wizard
Manual process
Using Data Block Wizard:
Select table name
Move editable fields from Available Columns list
to Database Items list
Use Layout Wizard to create form layout
Eyad Alshareef
32
Layout Editor
Use
to customize form display
Can
add images and static text to
enhance form appearance
Eyad Alshareef
33
Layout Editor
Eyad Alshareef
34
Creating a Data Block Form
Steps:
1. Create the data block using the Data Block
Wizard
2. Create the form layout using the Layout
Wizard
Eyad Alshareef
35
Data Block Wizard
Welcome page
Type page
Select table or view on which to base the block source
Table page
Select table associated with form
Enforce Integrity Constraint Check Box
Finish page
Option to use the Layout Wizard to automate creating
the layout
Eyad Alshareef
36
Layout Wizard
Canvas page
Select the canvas where the block is displayed
Data Block page
Select the fields that are displayed on the layout
Items page
Specify the column labels, heights and widths
Style page
Specify to create a form- or tabular-style layout
Eyad Alshareef
37
Layout Styles
Form style
One record appears on the form at a time
Tabular style
Multiple records display on the form in a
table
Eyad Alshareef
38
Create a new form based on MODULE1
Go to File/New/Form – a new module is added
to your object navigator window
Click on MODULE2 and rename it into
STUDENT
Eyad Alshareef
39
Create a data block based on a table
Right click on the STUDENT module and select Data
Block Wizard
Click next on the Data Block Wizard welcome page
Eyad Alshareef
40
Creating a data block (cont’s)
Select Table/view option
Select a table by clicking on Browse button
Eyad Alshareef
41
Selecting a table (cont’d)
When you click browse, you will be prompted to log in
Login into your usual account and select table
STUDENT from the displayed list
Eyad Alshareef
42
Select database items
Move all the attributes into selected attributes
pane using arrow buttons
Eyad Alshareef
43
Name your data block
Eyad Alshareef
44
Select the “… then call the Layout
wizard” option
Eyad Alshareef
45
Creating a layout
Layout wizard allows you to create a form layout
Click next on the welcome page and select content
canvas type
Eyad Alshareef
46
Select items to be displayed
Select items to be displayed
Modify the labels (prompts) and widths of
corresponding text boxes if necessary
Eyad Alshareef
47
Select a layout
Select form layout
Name the frame
Select the number of students to be displayed
Eyad Alshareef
48
Complete and view the form
Complete and view the form design
Eyad Alshareef
49
Form Builder Wizards
Are Re-entrant
You can select a block or layout, then re-enter it and
modify its properties using the Wizard
A Wizard is in re-entrant mode when its pages appear as
tabs
Eyad Alshareef
50
Creating a Form to Display
Multiple Records
Tabular layout
Display multiple records on same form
Select Tabular on Style page of Layout Wizard
Eyad Alshareef
51
Creating a Form to
Display Multiple Records
Use tabular layout to edit multiple table records
at the same time
Eyad Alshareef
52