Title: Introduction To Forms Builder
1Introduction ToForms Builder
2Lesson A Objectives
- Learn how Forms Builder displays forms in a Web
browser - Use a data block form to view, insert, update,
and delete database data - Create a data block form that displays a single
record at a time - Become familiar with the Object Navigator, and
use the Object Navigator to change form object
names - Use the Data Block and Layout Wizards to modify
form properties - Create a tabular-style data block form that
displays multiple records
3Displaying Forms in a Web Browser
- Forms are displayed in web browser
- Forms appear inside Forms Services window
- Forms Services window displays menus and toolbars
- Implemented using a Java Applet using Oracle9iAS
Containers for J2EE, or (OC4J) Instance - When developing, workstation runs web server and
web browser
4Forms Builder to Browser
5Using A Data Block Form Definitions
- Block group of related form items, such as text
fields and option buttons - Data block corresponds to a specific database
table, and contains objects, such as text fields
or option buttons, that display values from the
tables data fields - Data block form one or more data blocks
- Text items display text input fields
6Forms 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 - Query button group allows you to query data, has
two modes - Normal mode - can view data records, sequentially
step through the records, and change data values - Enter Query mode - can enter a search expression
in one of the form fields, and then retrieve the
associated records
7Forms Services Window
8Using a Form to View Table Records
- Retrieve specific table records
- Click the Enter Query button
- Type a search expression in one or more of the
form text items - Click the Execute Query button
- Retrieve all of the records in a table
- Place form in Enter Query mode and do not type
search condition
9Using a Form to Insert, Update, and Delete
Records
- To insert
- Use blank record that appears when opening a form
or as last line of query results - To update
- Retrieve record with a query, modify field and
save - To delete
- Retrieve record with a query, use Remove Record
button to delete
10Viewing and Interpreting Form Errors
- Some errors are detected, or trapped, within the
form and form issues the error message - Other errors are not detected until the form
sends the data values to the database and Oracle
DBMS issues the error message - To view information on database errors
- Click Help menu, Display Error
- Dialog box displays error information
11Viewing Information About Database Error
12Closing 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
13Creating 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
14The Object Navigator
15Creating 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
16Layout Editor
- Use to customize form display
- Can add images and static text to enhance form
appearance
17Layout Editor
18Running a Form
- Click Run Form button
- Form is compiled into a .fmx file for execution
- A text file with same name as form and .err
extension holds errors that occur when running
form
19Form Components and the Object Navigator
- Use Object Navigator to view information about
form components - Use buttons to expand and collapse form items
- Use Ownership View to group logically associated
components together - Use Visual View to group visually associated
components - Can rename objects
20Modifying Forms Using the Data Block Wizard and
Layout Wizard
- Wizards can be used to modify existing forms and
layouts in reentrant mode - Start wizard when component is selected to modify
component
21Creating a Form to Display Multiple Records
- Use tabular layout to edit multiple table records
at the same time
22Lesson B Objectives
- Create a data block form that is based on a
database view - Learn how to modify form properties to improve
form appearance and function - Create a master-detail form that contains
multiple data blocks - Format form text items using format masks
23Creating a Form Based on a Database View
- Similar to form based on table but read-only
24Modifying Form Properties
25Modifying Form Properties
- Use Property Palette of form object to modify
desired properties - To access right click object, select Property
Palette from menu - Intersection mode modifies properties for
multiple objects at the same time - To open in intersection mode, select multiple
objects before opening Property Palette
26Property Palette
27Modifying Form Prompts and Prompt Properties
Using the Layout Editor
- Edit prompts by changing text in layout editor
- Resize frame to realign items and view changes
- Use layout editor to modify font and point size
of prompts
28Modifying Text Item Properties Using the
Property Palette
29Creating a Data Block Form that Displays Data
from Multiple Tables
- Can create data block forms that display data
from multiple database tables which have
master-detail relationships - Master-detail relationship one database record
has multiple related records through foreign key
relationships - Use data block wizard to create master block (for
master table) first
30Creating a Data Block Form that Displays Data
from Multiple Tables
- Create detail blocks next and specify
relationship on master-detail tab - Use auto-join to allow Forms Builder to decide on
join condition - Use manual join to specify join fields
- Code is added to link form blocks together so
that when new master is selected, new detail
appears
31Multiple Master-Detail Blocks
32Using Format Masks to Format Character Strings
33Lesson C Objectives
- Use sequences to automatically generate primary
key values in a form - Create lists of values (LOVs) to provide lists
for foreign key values - Become familiar with different form items that
you can use to enter and modify data values
34Using Sequences to Generate Primary Key Values
- Form can be set up to automatically retrieve next
sequence number and populate primary key field - Form triggers respond to user events or system
actions - To create a trigger, specify
- Triggers object (i.e. specific button)
- Trigger event (i.e. button press)
- Code that executes
- Use PRE-FORM event to perform action when form
loads - Use Triggers dialog box to create triggers for
objects
35PL/SQL Editor
36Using PL/SQL to Create Form Trigger
- Type code to select next sequence value
- Refer to form item (ID text entry field) as
block_name.item_name - Compile code before use to check for syntax
errors - Must connect to database before compiling code
- PL/SQL editor displays syntax errors
37Syntax Error in PL/SQL Editor
38Creating a List of Values (LOV)
- Use a list of values (LOV) to eliminate user
errors - Pop-up list allows user to select value from list
of choices rather than typing - User can open LOV by
- Typing Ctrl-L with cursor in LOV text field
- Click Edit then Display List from Forms Services
menu - Clicking command button with attached trigger to
open LOV - LOV allows user to search for values using
wildcards - LOV data values come from a record group
39LOV Display
40Creating an LOV
- To create LOV
- Use LOV Wizard
- Manually create using Object Navigator
- LOV can contain one or more columns
- LOV appearance can be customized using layout
wizard - Create a button on main form to launch LOV using
button tool, attach form trigger to button that
opens LOV
41Representing Data Values Using Other Item Types
- Use radio buttons and checkboxes instead of text
fields for data entry - Radio buttons represent small list of mutually
exclusive values - To use radio buttons
- Create a radio group containing mutually
exclusive radio buttons - Specify radio buttons rather than text for item
type when creating form layout - Create individual radio buttons on canvas using
radio button tool - Specify initial value for radio group using
Property Palette
42Creating Checkboxes
- Use to represent choice of two opposing values
(i.e. On/Off) - Use label to indicate what checked value
represents - Configure Value when Checked and Value when
Unchecked to specify actual database values - Can specify a third value that checkbox has when
unmodified (such as NULL)
43Summary
- Forms Builder is used to provide users with
graphical user interface for manipulating
database objects - Form can represent one or more tables
- Form can be used to view, create, update and
delete table data - Form can be used to view data based on database
views - Use wizards to create and modify form information
- Use PL/SQL editor to edit, compile and debug code
- Actions can be associated with form objects and
events via Form Triggers