Sunteți pe pagina 1din 32

4

Creating a Basic Form Module

Copyright

Oracle Corporation, 1999. All rights reserved.

Objectives
After completing this lesson, you should be able to
do the following:

4-2

Create a form module


Create a data block
Modify a data block by using the Data Block Wizard
Modify the layout by using the Layout Wizard
Save, compile, and run a form module
Identify file formats and their characteristics
Create data blocks with relationships
Run a master-detail form module
Copyright

Oracle Corporation, 1999. All rights reserved.

Creating a New Form Module


Create an empty module
Create data blocks and items
Apply standards
Fine-tune layout
Set object properties
Add code
Test form module
4-3

Copyright

Oracle Corporation, 1999. All rights reserved.

Creating a New Form Module


Choose one of several methods:

Use wizards:
Data Block Wizard
Layout Wizard

Build module manually


Use template form

4-4

Copyright

Oracle Corporation, 1999. All rights reserved.

Form Module Properties

Name
property

Coordinate
System
property
4-5

Copyright

Oracle Corporation, 1999. All rights reserved.

Creating a New Data Block


Use Form Builder Wizards:

Data Block Wizard: Create a data block with


associated data source quickly and easily

Layout Wizard: Lay out data block contents for


visual presentation

Create manually

4-6

Copyright

Oracle Corporation, 1999. All rights reserved.

Creating a New Data Block


Launch Data
Block Wizard

Reentrant mode

Enter data
source

Launch Layout Reentrant mode


Wizard
New Data Block
Lay out data
block contents
4-7

Copyright

Oracle Corporation, 1999. All rights reserved.

Navigating the Wizards

4-8

Copyright

Oracle Corporation, 1999. All rights reserved.

Launching the Data


Block Wizard
In Form Builder, do one of the following:

Select Tools>Data Block Wizard.


Click the right mouse button.
Use the Data Block Wizard option.

Select the Data Blocks node and then click the


Create icon in Object Navigator.

Use the Data Block Wizard option.

Use the Data Block Wizard button on the toolbar in


the Layout Editor

4-9

Copyright

Oracle Corporation, 1999. All rights reserved.

Data Block Wizard: Type Page

4-10

Copyright

Oracle Corporation, 1999. All rights reserved.

Data Block Wizard: Table Page

4-11

Copyright

Oracle Corporation, 1999. All rights reserved.

Layout Wizard: Items Page

4-12

Copyright

Oracle Corporation, 1999. All rights reserved.

Layout Wizard: Style Page

4-13

Copyright

Oracle Corporation, 1999. All rights reserved.

Layout Wizard: Rows Page

4-14

Copyright

Oracle Corporation, 1999. All rights reserved.

Data Block Functionality


Once you create a data block with the wizards,
Form Builder automatically creates:

A form module with database functionality


including query, insert, update, delete

A frame object
Items in the data block
A prompt for each item

4-15

Copyright

Oracle Corporation, 1999. All rights reserved.

Modifying the Layout


Reentrant Layout Wizard:
Select frame in Object Navigator.
Select Tools>Layout Wizard.
Or
Select frame in Layout Editor.
Click Layout Wizard button.

Layout Editor:
Select Tools>Layout Editor.
Make changes manually.

Frame Property Palette: Change property values.


4-16

Copyright

Oracle Corporation, 1999. All rights reserved.

Template Form

4-17

Copyright

Oracle Corporation, 1999. All rights reserved.

Saving a Form Module


Save the form module:
Select File>Save.
Click the Save icon.

Enter a filename.
Save to one of the following:
File system
Database

4-18

Copyright

Oracle Corporation, 1999. All rights reserved.

Compiling a Form Module


Compile explicitly:
Select File>Administration>Compile File.
Launch the Form Compiler component.
Initiate from Command line interface.

Compile implicitly:
Select Tools>Preferences.
Set the Build Before Running preference.

4-19

Copyright

Oracle Corporation, 1999. All rights reserved.

Running a Form Module


Forms Runtime component
Command line interface
Form Builder component
Select Program>Run.
Click the Run icon.

4-20

Copyright

Oracle Corporation, 1999. All rights reserved.

Module Types

4-21

Form
Module

.fmb

.fmx

.fmt

Menu
Module

.mmb

.mmx

.mmt

PL/SQL
Library

.pll

.plx

.pld

Object
Library

.olb

Copyright

Oracle Corporation, 1999. All rights reserved.

.olt

Form Block Relationships

Master

Master

Detail

Detail

Master

Detail

Detail

4-22

Copyright

Oracle Corporation, 1999. All rights reserved.

Detail

Data Block Wizard:


Master-Detail Page

4-23

Copyright

Oracle Corporation, 1999. All rights reserved.

Relation Object
New relation object created in Object Navigator
under master data block node

Default name assigned:

MasterDataBlock_DetailDataBlock

Triggers and program units generated


automatically

4-24

Copyright

Oracle Corporation, 1999. All rights reserved.

Creating a Relation Manually

4-25

Copyright

Oracle Corporation, 1999. All rights reserved.

Deletion Properties
= Deleted

Isolated

Cascading

Nonisolated
No Detail Rec
Master-Detail
Records
Nonisolated
Detail Rec

4-26

Copyright

Oracle Corporation, 1999. All rights reserved.

Coordination Properties

Default

4-27

Copyright

Deferred
with auto
query

Oracle Corporation, 1999. All rights reserved.

Deferred
without
auto query

Join Condition
Creates primary-foreign key link between blocks
Define using:
Block and item names
SQL equijoin syntax

4-28

Copyright

Oracle Corporation, 1999. All rights reserved.

Running a Master-Detail Form Module


Automatic block linking for:
Querying
Inserting

Default deletion rules: Cannot delete master record


if detail records exist

4-29

Copyright

Oracle Corporation, 1999. All rights reserved.

Summary
Build a new form module:
Using Form Builder wizards
Manually
Using a template form

Use the Data Block Wizarddata source.


Use the Layout Wizardvisual presentation.

4-30

Copyright

Oracle Corporation, 1999. All rights reserved.

Summary

4-31

Modify layoutreentrant wizards.


Save, compile, and run a form module.
Use module types and storage formats.
Create master-detail form module.

Copyright

Oracle Corporation, 1999. All rights reserved.

Practice 4 Overview
This practice covers the following topics:

Creating new form modules


Creating data blocks by using Form Builder
wizards

Modifying data block layout by using the Layout


Wizard in reentrant mode

Saving and running the form modules

4-32

Copyright

Oracle Corporation, 1999. All rights reserved.

S-ar putea să vă placă și