Beruflich Dokumente
Kultur Dokumente
FORMS
Oracle forms are GUI based applications. It is to develop user friendly Interface for front end users in-order
to query the details and Modify the details.
Oracles GUI based forms tools are :
Form Builder: It is used to design the layout of data entry form as well as to bind event driven PL/SQL code to the
form for data validation and navigation purpose.
Forms Compiler : It is used to compile the file, which was developed by the form builder . It creates a binary file
and save the file to hard, which can be executed.
Form Runtime : It is used to run the compiled file, which was created by Forms Compiler. To run an oracle form
only the Forms Runtime is required.
Application built using Oracle Form Builder contain the following components
1) Form Modules
2) Menus
3) PL/SQL Libraries
4) Object Libraries
5) Database Objects
1) Form Module
It is primary object created using From Builder. Form Module is collection of objects such as data blocks,
canvases, frames, items and event based PL/SQL code blocks bound to triggers
2) Menus
The Menu module is a collection objects such as menu items, sub menu items and event based PL/SQL code
blocks.
3) PL/SQL Libraries
The library module is a collection of PL/SQL procedures, functions, Package Spec and Package Body.
These can be accessed form the forms and menus.
4) Object Libraries
The Object Library provides an easy method of reusing objects.
We can use the Object Library to:
Create, store, maintain, and distribute standard and reusable objects.
Rapidly create applications by dragging and dropping predefined objects to your form.
5) Database Objects
Oracles interactive tool ( SQL * PLUS ) allows the creation of database objects like stored procedures,
functions and database triggers using appropriate SQL and PL/SQL sntax.
FORM MODULE
A form module consists of the following components
1) Block
2) Items
3) Frames
4) Canvas Views
5) Window
Blocks :
1) A form contains one or more blocks. Blocks are logical containers and have no physical representation Only the
item contained in a block are visible in the form interface.
2) A block, which is connected to a database object is called as Data Aware Block. A block, which is not connected
to any database object is called as Control Block
3) A block can be Connected to a database object like a table, view or synonym. A block can also be connected to
stored procedures.
4) A table, which is connected to block is called as base table.
Items :
1) Items are objects contained in blocks. A Block serves as container for items where as Item serves as contained for
data.
2) Some of Items of the block, bound to the columns of base table and some of the items of the block may not be
bounded to columns of the base table.
From : Form is an interface for end user, which enable the end user to give input to an application. Form consists of
G.U.I components for user friendly. Forms are used to design GUI ( user interface ) , to enable the end user
to display, add records, modify records, and delete records in table. It is a user friendly. ( select, insert,
update, delete )
Note : 1) Reports are used only for display records. ( Select )
2) Every thing is called as an object in the form builder and report builder.
Form Builder Versions 4.5 / 6i / 9i / 10G
A Form consists of following Interfaces
1) Layout Editor
2) Object Navigator
3) Property Palette
4) PL/SQL Editor
5) Menu Editor
6) Wizard
1) Layout Editor :
The Layout Editor is a graphical design facility for creating and arranging interface items and
graphic objects in a form.
Horizontal
and
Vertical Rulers
Layout
Editor
Context
Tool
Palette
Canvas
Status
Bar
Message
Bar
Canvas :
A canvas is a surface--inside a window container--on which we place the interface items and boilerplate
objects that end users interact with when they run the form. By default, any canvas you create at runtime is assigned
to the window named WINDOW1. To explicitly associate a canvas to a specfic window, set the canvas' Window
property accordingly.
Layout Editor Context :
The title bar of the Layout Editor window displays context information, including the name of the current
form, the name of the canvas being edited, and the name of the current block. When you create an item by drawing
it on a canvas in the Layout Editor, Form Builder assigns the item to the current block, as indicated by Layout Editor
block context. You can change Layout Editor block context using the Block poplist on the toolbar.
Rulers :
The horizontal and vertical rulers at the top and left side of the workspace provide a reference for sizing and
arranging objects in the Layout Editor. To hide rulers, deselect the Rulers option on the View menu.
Layout Editor ruler units can be set to character cells, inches, centimeters, or points. To display the Ruler Settings
dialog, choose ViewSettingsRuler Settings.
2) Object Navigator
The Object Navigator provides a hierarchical display of the objects in all open modules. Objects are
grouped under the appropriate node. For example, all of the windows defined in a form module appear under the
Windows node. The Windows node, in turn, appears under the appropriate form module object.
F3 is a shortcut key to access the object navigator
( OR )
Window Object Navigator
4) PL/SQL Editor
The PL/SQL Editor is where you enter and compile code objects. Code objects in Form Builder include
event triggers, subprograms (functions and procedures), menu item commands, menu startup code, and packages.
5) Menu Editor :
The Menu Editor is a Form Builder design tool you use (along with the Object Navigator and Property
Palette) to create and arrange custom form menu modules and popup menus.
6) Wizards
Form Builder includes several wizards to automate frequently performed tasks for both beginning and
advanced users.
Using a wizard, you can do the following:
1) create or modify a form
2) create or modify a data block
3) create and arrange items within a frame
4) create or modify an LOV
5) create or modify chart item
Window : It is an area where we can display the canvas, we can have the multiple canvases in one
window. Windows are of two types.
1) Model : We can not resize and minimize
2) Model Less window : User Friendly we can easily navigate other forms and minimize and maximize
It is a default one. If it is required to make it as model window, set property Model : Yes
Canvas : This object represents a background entity on which you place interface items, such as check boxes, radio
groups, and text items.
Eg:
EmpNo
EmpName
Salay
DeptNo
Using Wizard
Step1; Start the form builder
1) Select use Datablock Wizard
2) click on Next
3) select Table or view
4) Specify the name table
5) click on refresh
6) supply the user Id and password ( scott/tiger )
7) select the required fields ( >> all )
8) select create data block wizard and call
9) click on finish
10) layout wizard next it shows the name of the canvas
11) next
12) select the required fields to be displayed in the layout (Empno, Ename, Sal, Deptno)
13) Modify the Prompt and width as desired
14) Next
15) select the form/table as desired ( select table ) and click on next
Form option is used to display one record at time where table option is used to more than one record
at a time.
16) supply the frame title, No of record displayed, scroll bar and next
17) Finish
18) compile and run the form
Program Compile all
File administration Compile File ( Ctrl + T )
Program Run Form Client/Server ( Ctrl + R )
In place of last two steps : click on run tool ( shows in green color )
19) to see the records go to query execute to display ; enter clear
20) Next >> Previous <<
21) insert button , delete button, modify the record and save
Adding New Records ( enter the data and click on Save button )
Deleting records ( place the cursor on the required record and select delete )
Action Exit : to exit from the report.
Developing a Simple form manually
Above example manually
Step1; Start the form builder
1) Select manually
2) Select Data block and create
3) Built new block manually
4) Data Block Property palette define the properties
Name : EMP_DETAILS ( as desired )
Navigation Style : Change Record
No.of records displayed : 1
Data base block : yes
Data source name : emp
Data source columns : EMPNO, ENAME, SAL, DEPTNO
5) select Canvas and create
6) F2 to go canvas or double click
7) Design the form as shown below
CONTROLS
Tools on the Tool Palette are called as Controls
List of Controls
1) Frame
2) Text
3) Text Item
4) Button
5) Check Box
6) Radio Button
7) List Item
8) Display Item
9) Stacked Canvas
12) Select
13) Rotate
14) Magnify
15) Reshape
16) Rectangle
17) Line
18) Ellipse
19) Arc
20) Polygon
21) Polyline
Frame :
A frame is a graphic object that appears on a canvas. You use frames to arrange the items within a block.
When you arrange items within a frame, you can, for example, create a form-style arrangement, define the distance
between items and prompts, specify margins and offsets, and so on.
Frames provide these benefits:
Text (
T ):
Text is used set labels on other controls such as Text Item, Headers and etc.
Text Item : It is for user inputs and to display details of some item. Text will be assign to every column of the table
automatically.
Properties ( IMP )
Name
: as desired
Item Type
: TextItem
Enabled
: Yes / No
Multi Line
: Yes/ No
Data Type
: as desired
Initial Value
: as desired
Required
: If required
Summary Function
: if required
Database Item
: Yes/ No
Column Name
: as desired
Previous example focused on the text items ( Manual development of simple application )
Working with Check Boxes
It is either enabled or disabled. We can select multiple check boxes at a time.
Properties :
Name
: as desired
Item Type
: Check Box
Label
: Yes
Maximum Length
Initial Value
: 5 ( as desired )
: Y ( default value )
: as desired
Item Type
: Check Box
Label
: ENABLE
:Y
: Char
Maximum Length
Initial Value
:1
:Y
: Manager
Manager /
Supervisor /
Clerk
Gender : Male /
Female
Layoutasshownbelow.
Gender char)
1) Create data block with above fields
2) Radio Group for JOB
When 1st radio button created, then Radio Group will be created automatically.
Radio Button properties
Name : Manager
Label : Manager
Radio Button Value : Manager
Create 2nd Radio button for Supervisor and add to JOB Group ( old group)
Create 3rd Radio button for CLERK and add to JOB Group( old group)
2) Set the properties of Radio Group
Name : JOB
Data Type : Char
Initial Value : Manager
Database Item : Yes
Column Name : JOB
Radio Button Group :
We must specify a valid initial value unless one of the following is true:
The item's Mapping of Other Values property has a non-null value.
The value associated with one of the radio buttons in the group is Null.
Note: A radio group in a null record appears with no radio button selected.
Display Item
Display items are similar to text items with the exception that display items only store and display fetched
or assigned values. Display items are generally used as graphic or as conditional text.
It is advantageous to use display items when possible, because they require less memory than a text items.
Runtime Behavior : End users cannot navigate to display items or edit display item values.
Note: Multi-line display items do not automatically wrap text between characters or words; multiple line values
break only at newline characters.
A Simple Application to calculate and display PF, HRA and Gross Salary
: PF ( as desired )
: if required
: : sal*0.10
Database Item : No
Repeat the same HRA and Gross Salary
HRA Formula :
: sal*0.20
: sal + : PF + : HRA + nvl(: COMM,0)
List Item
JOB and DeptNo are to be provided from the list
: JOB ( as desired )
Item Type
: List Item
Enabled
: Yes
Elements in list :
List Element : MANAGER
Pop List we can see all the values in the list at a time and can not be supplied user desired value
Tlist we can see only one values in the list at a time. It provides scrolling option and can not be
supplied user desired value.
CombBox we can see all the values in the list at a time ( similar to Pop List ) and can also be
supplied user desired values. It will not work for the foreign key columns.
Data Type
: Char
: as desired
Database Item
: Yes
Column Name
: JOB
: DEPT ( as desired )
Item Type
: List Item
Enabled
: Yes
Elements in list :
List Element : OPERATIONS
Data Type
: Number
: as desired
Database Item
: Yes
Column Name
: DEPT
Record Group
This object represents an internal Form Builder data structure that has a column/row framework similar to a
database table. However, unlike database tables, record groups are separate objects that belong to the form module
in which they are defined. A record group object have an unlimited number of columns of type CHAR, LONG,
NUMBER, or DATE provided that the total number of columns does not exceed 64K. Record group object column
names cannot exceed 30 characters.
Static
Query based
Non-Query based
: LOV_DEPTNO
Note : Check the items in data block, the fields which are added with property shows with arrow
and red color
Visual attributes.
Visual attributes are the font, color, and pattern properties that you set for form and menu objects that appear in your
application's interface. Visual attributes can include the following properties:
Font properties: Font Name, Font Size, Font Style, Font Width, Font Weight
Color and pattern properties: Foreground Color, Background Color, Fill Pattern, Charmode Logical Attribute,
White on Black
Steps:
1) select and create
2) set the properties as desired, Name : VIS and others as desired
3) map to the filed
set property
visual attribute group : VIS
Difference between Property class and Visual attributes
Property class
1) Group of Properties
2)We can not change dynamically
Visual attributes
Block Level : It Will be executed when we enter into the data block.
Record level : It Will be executed for every record.
Item Level : It Will be executed for the Particular Item.
Types Of Triggers:
1)When Triggers
2)Validation Triggers
3) Transactional Triggers
4) Navigational Triggers
5)Query Time Triggers
6)On Triggers
7)Pre Triggers
8)Post Triggers
9)Mouse Event Triggers
10)Key Triggers.
11)Master Detail Triggers
WHEN Triggers :
WHEN-NEW-FORM-INSTANCE
WHEN-NEW-BLOCK-INSTANCE
WHEN-NEW-RECORD-INSTANCE
WHEN-NEW-ITEM-INSTANCE
WHEN-VALIDATE-RECORD
WHEN-VALIDATE-ITEM
WHEN-WINDOW-CLOSED
WHEN-BUTTON-PRESSED
WHEN-MOUSE-CLICK
WHEN-MOUSE-DOUBLECLICK
Eg1: WHEN-BUTTON-PRESSED
Definition : Level form, block, or item
Requirement :
EmpNo
EmpName :
EmpSal
EmpComm :
Total Sal :
[ Find_Total_Sal ] when click on this button
Total Sal value : sal + comm.
- At any level
Trigger:
declare
x number;
begin
x:=show_alert('VAL'); -- Message(value has been changed):
end;
(or)
empno should be from 100 to 10000
declare
begin
if ( :empno <100 or :empno>10000) then
Message ( 'invalid input enter the value from 100 to 10000');
else
Message('valid input');
end if;
end;
WHEN-VALIDATE-RECORD : when user changed the values of any fields and saved the record, then it will
be fired.
Definition Level : form or block
Eg : Block level ( EMP )
declare
begin
Message( 'Record value has been change');
end;
NAVIGATIONAL TRIGGERS :
These triggers will be fired When we navigate
from one form to another form
from one data block to another data block
from one record to another record these triggers
from one field to another field then these triggers
PRE-FORM
WHEN-NEW-FORM-INSTANCE
POST-FORM
PRE-BLOCK
WHEN-NEW-BLOCK-INSTANCE
POST-BLOCK
PRE-RECORD
WHEN-NEW-RECORD-INSTANCE
POST-RECORD
PRE-TEXT-ITEM
WHEN-NEW-ITEM-INSTANCE
POST-TEXT-ITEM
PRE-FORM
WHEN-NEW-FORM-INSTANCE
POST-FORM :
WHEN-NEW-RECORD-INSTANCE
POST-RECORD
WHEN-NEW-ITEM-INSTANCE
POST-TEXT-ITEM
Perform an action immediately after the input focus moves to a different item. If the new item is in a different
block, fires after the When-New-Block-Instance trigger.
POST-TEXT-ITEM :
Manipulate an item when Form Builder leaves a text item and navigates to the record level.
PRE-BLOCK
WHEN-NEW-BLOCK-INSTANCE
POST-BLOCK
PRE-BLOCK :
Perform an action before Form Builder navigates to the block level from the form level.
WHEN-NEW-BLOCK-INSTANCE :
Perform an action immediately after the input focus moves to an item in a block other than the block that previously
had input focus.
POST-BLOCK :
Manipulate the current record when Form Builder leaves a block and navigates to the form level.
Triggers Used at the Form Level:
1) PRE-LOGON
2) ON-LOGON
3) POST-LOGON
4) PRE-FROM
5) WHEN-NEW-FROM-INSATNCE
6) POST-FORMS-COMMIT
7) PRE-LOGOUT
8) ON-LOGOUT
9) POST-LOG-OUT
Triggers Used at the Block Level :
1) PRE-BLOCK
2) PRE-RECORD
3) WHEN-NEW-BLOCK-INSTANCE
4) WHEN-NEW-RECORD-INSTNACE
5) WHEN-VALIDATE-RECORD
6) POST-RECORD
7) POST-BLOCK
8) PRE-QUERY
9) POST-QUERY
10) PRE-SELECT
11) POST-SELECT
12) PRE-INSERT
13) POST-INSERT
14) PRE-DELETE
15) POST-DELETE
16) PRE-UPDATE
17) POST-UPDATE
Triggers Used at the Item Level :
1) PRE-TEXT-ITEM
2) WHEN-NEW-ITEM-INSTANCE
3) WHEN-VALIDATE-ITEM
4) POST-TEXT-ITEM
5) KEY-NEXT-ITEM
6) WHEN-MOUSE-ENTER
7) WHEN-MOUSE-LEAVE
8) WHEN-MOUSE-CLICK
9) WHEN-MOUSE-DOUBLE-CLICK
10) WHEN-MOUSE-UP
11) WHEN-MOUSE-DOWN
12) WHEN-MOUSE-MOVE
2) WHEN-VALIDATE-ITEM
3) POST-TEXT-ITEM
4) PRE-TEXT-ITEM
5) WHEN-NEW-ITEM-INSTANCE
To Hide Fields of the Form
Set property of the filed :
Physical :
Canvas : Null.
Inserting data for hidden fields
Write the PRE-INSERT Query at the Block Level
Eg : EmpNo ( from the Sequence )
Hiredate : sysdate
PRE-INSERT ( PL/SQL Editor )
Select EMPNO_SEQ.nextval into :EMP.EMPNO from Dual ;
:EMP.hiredate:=sysdate;
Validations :
Length of the ENAME should not be more than 15
Go to ENAME filed and write the When validate Trigger.
IF LENGTH ( :EMP.ENAME ) > 8 THEN
Message('EMP Name Should Not be Greater than 8 Chars');
raise FORM_TRIGGER_FAILURE;
END IF;
Comparison of Salary and COMM
Condition Comm Value Should not lessthan 100 and greater than Salary
On COMM Filed write the WHEN-VALIDATE-ITEM Trigger
If ( :EMP.COMM > :EMP.SAL OR :EMP.COMM <= 100 ) THEN
Message( 'Invalid Commission');
Raise FORM_TRIGGER_FAILURE;
END IF;
If end user entered the data from top bottom the validation is fine.
If end user entered the data in a random i.e entered the salary after the commission, then above will not work.
In this scenario go for better to WHEN-VALIDATE-RECORD Trigger
(WHEN-VALIDATE-ITEM may be or may not be required )
MASTER-DETAIL TRIGGERS :
Defining the Master/Parent and Detailed/Child Relation Ship :
Example to establish relation ship between Dept ( Mater table ) and Emp ( Detailed table )
Using Wizard
1) Create Master Table ( Dept ) and Create Detailed Table (EMP)
Isolated,
Cascade
Extra Information :
Prevent Master Level Operations : Yes / No
Differed : Yes
Automatic Query : Yes.
Non-Isolated : (Default) The master record cannot be deleted, if associated detail records exist
in the database
Isolated : The master record can be deleted, but the associated detail records are not deleted from the database.
Cascade : The master record can be deleted, and any associated detail records are automatically
deleted from the database at commit time.
When Master detail relationship system will generate following triggers
ON-CHECK-DELETE-MASTER
ON-CLEAR-DETAILS
ON-POPULATE-DETAILS
PRE-DELETE
Non-Isolated:
ON-CLEAR-DETAILS
ON-POPULATE-DETAILS
ON-CHECK-DELETE-MASTER
Isolated :
ON-CLEAR-DETAILS
ON-POPULATE-DETAILS
Cascade :
ON-CLEAR-DETAILS
ON-POPULATE-DETAILS
PRE-DELETE
The following two are common three types
ON-CLEAR-DETAILS
ON-POPULATE-DETAILS
Definition Level :
form or block
On-Check-Delete-Master Trigger :
Form Builder creates this trigger automatically when you define a master/detail relation and set the Delete Record
Behavior property to Non-Isolated. It fires when there is an attempt to delete a record in the master block of a
master/detail relation.
On-Clear-Details Trigger :
Fires when a coordination-causing event occurs in a block that is a master block in a Master/Detail relation. A
coordination-causing event is any event that makes a different record the current record in the master block.
On-Populate-Details Trigger :
Form Builder creates this trigger automatically when a Master/Detail relation is defined. It fires when Form Builder
would normally need to populate the detail block in a Master/Detail relation.
MANUALLY
Only difference is 1st step
1) Create Master Table ( Dept ) and Create Detailed Table (EMP)
Create block for master table (Dept) and Layout frame ( Dept )
1) select data block and create.
2) Properties
Name : DEPT
Navigation Style : Same record / Change Record.
No.of Record Displayed : 1 ( master and form type )
Database Block : Yes
Data Source Type : table
Query Data Source Name : DEPT
Query Data Source Columns : deptno, dname, loc
Scroll Bar : No ( since it is a single record output )
(form_name
VARCHAR2,
activate_mode NUMBER,
session_mode NUMBER,
data_mode
NUMBER,
paramlist_id PARAMLIST);
1) Multiple Child Forms can be opened
2) activate_mode :
activate_mode = ACTIVATE (The default.) Sets focus to the form to make it the active form in the
application.
activate_mode = NO_ACTIVATE Opens the form but does not set focus to the form. The current form
remains current.
3) session_mode :
session_mode = NO_SESSION ( default ) Opened form can share the same database session as the form
from which it was invoked.
session_mode = SESSION it can create a separate session of its own.
4) data_mode :
data_mode = NO_SHARE_LIBRARY_DATA (The default.) At runtime, Form Builder will not share data
between forms that have identical libraries attached (at design time).
data_mode = SHARE_LIBRARY_DATA At runtime, Form Builder will share data between forms that
have identical libraries attached (at design time).
NUMBER,
switch_menu
NUMBER,
query_mode
NUMBER,
data_mode
NUMBER,
paramlist_name VARCHAR2);
1) Only One Child can be Opened From the parent
2) display
display = HIDE (The default) Form Builder will hide the calling form before drawing the called form.
display = NO_HIDE Form Builder will display the called form without hiding the calling form.
3) switch_menu
switch_menu = NO_REPLACE (The default.) Form Builder will keep the default menu module of the
calling form active for the called form.
switch_menu = DO_REPLACE Form Builder will replace the default menu module of the calling form
with the default menu module of the called form.
4) query_mode
query_mode = NO_QUERY_ONLY (The default.) Form Builder will run the indicated form in normal
mode, allowing the end user to perform inserts, updates, and deletes from within the called form.
query_mode = QUERY_ONLY Form Builder will run the indicated form in query-only mode, allowing the
end user to query, but not to insert, update, or delete records.
5) data_mode
data_mode = NO_SHARE_LIBRARY_DATA (The default.) At runtime, Form Builder will not share data
between forms that have identical libraries attached (at design time).
data_mode = SHARE_LIBRARY_DATA At runtime, Form Builder will share data between forms that
have identical libraries attached (at design time).
NUMBER,
query_mode
NUMBER,
data_mode
NUMBER,
paramlist_name VARCHAR2 );
1) Once Child from is Opened Parent from will be Closed.
2) rollback_mode :
rollback_mode = TO_SAVEPOINT (The default.) Form Builder will roll back all uncommitted changes
(including posted changes) to the current form's savepoint.
rollback_mode = NO_ROLLBACK Form Builder will exit the current form without rolling back to a
savepoint. You can leave the top level form without performing a rollback, which means that you retain any
locks across a NEW_FORM operation. These locks can also occur when invoking Form Builder from an
external 3GL program. The locks are still in effect when you regain control from Form Builder.
rollback_mode = FULL_ROLLBACK
posted changes) that were made during the current Runform session.
FULL_ROLLBACK from a form that is running in post-only mode. (Post-only mode can occur when your
form issues a call to another form while unposted records exist in the calling form. To avoid losing the
locks issued by the calling form, Form Builder prevents any commit processing in the called form.)
3) query_mode:
query_mode = NO_QUERY_ONLY (The default.) Runs the indicated form normally, allowing the end
user to perform inserts, updates, and deletes in the form.
query_mode = QUERY_ONLY Runs the indicated form in query-only mode; end users can query records,
but cannot perform inserts, updates or deletes.
4) data_mode :
data_mode = NO_SHARE_LIBRARY_DATA (The default.) At runtime, Form Builder will not share data
between forms that have identical libraries attached (at design time).
data_mode = SHARE_LIBRARY_DATA At runtime, Form Builder will share data between forms that
have identical libraries attached (at design time).
For most GUI applications, using OPEN_FORM is the preferred way to implement multiple-form functionality.
When Click Emp Details Button it has to Detailed from with list employees working in a perticular Dept, which was
selected in the Master form ( in the above selected Deptno : 10 )
Detailed Form
Write the PRE-FORM trigger at the Master Form level to declare the Global Variable as shown below
PRE-FORM
:GLOBAL.DEPTNO:=0; -- Global variable decalaration.
Write the the WHEN-BUTTON-PRESSED trigger with follwing Code
WHEN-BUTTON-PRESSED
:GLOBAL.DEPTNO:= :DEPT.DEPTNO; -- Current record Deptno will taken into the Global variable
open_FORM('C:\CUST-FORMS\EMP');
In the Property Palette, set the Visual Attribute Group property as desired, then set the individual attributes (Font
Name, Foreground Color, etc.) to the desired settings.
In the Layout Editor, select an item or a canvas and then choose the desired font, color, and pattern attributes from
the Font dialog and Fill Color and Text Color palettes.
Define a named visual attribute object with the appropriate font, color, and pattern settings and then apply it to one
or more objects in the same module. You can programmatically change an object's named visual attribute setting to
change the font, color, and pattern of the object at runtime.
Subclass a visual attribute that includes visual attribute properties and then base objects on it that inherit those
properties.
Types of Visual Attribute :
1) Common : This is for all objects of the form Module ( from top to Bottom )
2) Prompt : This is only for Items Objects
3) Title : This is only for Frame
Created the visual attribute as desired and go to property of the required Object and set Visual Attribute property.
Property Class :
This is similar to the Visual Attribute, the difference here we choose the Attributes as desired, where as in case of
Visual Attributes we have use the provided attributes one only.
Define the property class and go properties and set at the Sub Class Information
If Visual Attributes and Property Class both are set on the same Object then Visual Attribute will be priority.
In the Apps Applications these are not requited. Apps provides predefined property class from each end every item
Simply we can select the Sub Class information in the Form Module Objects.
Program Units :
It is collection if Packages, Procedures and Functions
This object represents a named PL/SQL function or procedure that you write in a form, menu, or library module.
Although trigger objects are the primary mechanism for adding programmatic control to a Form Builder application,
this object supplements trigger objects by allowing you to reuse code without having to enter it in multiple triggers.
Scope of program unit is with in the Current Form only
Defining Program Units :
Mathematical Operations On Two numbers:
Create the Block with the following non database items
1) Text Filed ( Num1 )
2)Text Filed ( Num2 )
3) Text Filed (Result )
4) Button ( add)
5) Button ( sub )
Create the Block Manually
Block Properties :
Name : NUMBERS
Data Base
Database Datablock : No
Query Allowed : No
Query Data Source Type : None
Insert Allowed : Yes ( to enter the value in item )
Update Allowed : yes
Delete Allowed : yes
Advance table
DML Data Target type : None
Go to Items of above Data block ( Non database block called as Control block ) and add the items
Set the Properties
Name : NUM1
Data Type : Number
Database Item : No
Query Allowed : No
Prompt : Enter Num1
Repeat the same for remaining
Create the Canvas
Select all the items in the block and go to properties (f4)
Select the Canvas to get the layout
Layout will be as shown below
VARCHAR2,
display VARCHAR2);
Built-in Type unrestricted procedure
Enter Query Mode yes
Eg:
Declare
L_Id PARAMLIST;
Begin
PROCEDURE RUN_PRODUCT
(REPORTS,
fil_path \ file.rep,
SYNCHRONOUS,
RUNTIME,
FILESYSTEM,
L_Id,
NULL);
Parameters
product: Specifies a numeric constant for the Oracle product you want to invoke: FORMS specifies a Runform
session. GRAPHICS specifies Graphics Builder. REPORTS specifies Report Builder. BOOK specifies
Oracle Book.
Module : Specifies the VARCHAR2 name of the module or module to be executed by the called product. Valid
values are the name of a form module, report, Graphics Builder display, or Oracle Book module. The
application looks for the module or module in the default paths defined for the called product.
Commode:
Specifies the communication mode to be used when running the called product. Valid numeric
);
Note : DML and DCL commands can be executed directly from the trigger PL/SQL code.
Canvases :
These are of five types :
1) Content, 2)Stacked, 3) Horizontal Toolbar, 4) Vertical Toolbar, and 5) Tab pages
Content Canvas : The most common canvas type is the content canvas (the default type). A content canvas is the
"base" view that occupies the entire content pane of the window in which it is displayed. You
must define at least one content canvas for each window you create.
Stacked Canvas :
A stacked canvas is displayed atopor stacked onthe content canvas assigned to the current
window. Stacked canvases obscure some part of the underlying content canvas, and often are
shown and hidden programmatically. You can display more than one stacked canvas in a
window at the same time.
Dname
loc
ename
sal
Stacked canvas
Emp
dept
Here dept no is 20 then stacked canvas has to be displayed and initially canvas should be hidden
Steps
1) create the dept block by using wizard ( form type) ( default canvas is content type)
Prop Name : CONT ( as desired )
2) go to tool palette and select stacked canvas and place on the previous canvas (
CONT )
5) To set the canvas priority go to window property functions Primary Canvas CONT
6) To hide the stack canvas initially write the trigger at form level
When_new_form_instance
hide_view(stack);
6) to hide the stack canvas dynamically when dept no is 20, then write trigger on the dept block
WHEN-NEW-RECORD-INSTANCE
begin
if( :dept.deptno=20 ) then
GO_BLOCK ('EMP');
SHOW_VIEW('STACK');
EXECUTE_QUERY;
GO_BLOCK('DEPT');
ELSE
HIDE_VIEW('STACK');
END IF;
end;
eg2) : when click on button ( placed on the content canvas ), the stacked canvas to be displayed.
Toolbar Canvas :
A toolbar canvas often is used to create toolbars for individual windows. You can create two
types of toolbar canvases: horizontal or vertical. Horizontal toolbar canvases are displayed at
the top of a window, just under its menu bar, while vertical toolbars are displayed along the
far left edge of a window.
Horizontal
: HT
Vertical
: VT
5) Object Navigator HT
Design the layout : place the required components such as buttons, Text fields, Radio Buttons
Write the triggers on the components as desired
6) Object Navigator VT
Design the layout : place the required components such as buttons, Text fields, Radio Buttons
Write the triggers on the components as desired
Tab Canvas :
A tab canvasmade up of one or more tab pages allows you to group and display a large
amount of related information on a single dynamic Form Builder canvas object. Like stacked
canvases, tab canvases are displayed on top of a content canvas, partly obscuring it. Tab
pages (that collectively comprise the tab canvas) each display a subset of the information
displayed on the entire tab canvas.