Oracle Forms Developer 10g Build Interne PDF
Oracle Forms Developer 10g Build Interne PDF
Oracle Forms Developer 10g Build Interne PDF
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
sf
an
- t r
Oracle Forms Developer n on 10g:
a
Build InternetaApplications
s
m ) h ideฺ
co tGuide G u
VolumeilIฺ• Student
g ma tuden
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u l a
b d
A
D17251GC20
Edition 2.0
September 2006
D47401
IT Bangla Ltd
Disclaimer
Pam Gamer
This document contains proprietary information and is protected by copyright and
other intellectual property laws. You may copy and print this document solely for your
Technical Contributors own use in an Oracle training course. The document may not be modified or altered in
and Reviewers any way. Except where your use constitutes "fair use" under copyright law, you may
not use, share, download, upload, copy, print, display, perform, reproduce, publish,
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Laurent Dereac license, post, transmit, or distribute this document in whole or in part without the
Sujatha Kalastriraju express authorization of Oracle.
Manish Pawar The information contained in this document is subject to change without notice. If you
Bryan Roberts find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Raza Siddiqui
warranted to be error-free.
Lex van der Werff
Restricted Rights Notice
Editors If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
Aju Kumar applicable:
Nita Pavitran
U.S. GOVERNMENT RIGHTS
a b le
Graphic Designer er
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
Steve Elwood license agreement and/or the applicable U.S. Government contract.
a sf
disclose these training materials are restricted by the terms of the applicable Oracle
n
- t r
Trademark Notice
on
Publisher
s an
Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle
Srividya Rameshkumar ha deฺ
Corporation and/or its affiliates. Other names may be trademarks of their respective
)
owners.
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
H
u l ah
Abd
IT Bangla Ltd
Contents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preface
I Introduction
Objectives I-2
Course Objectives I-3
Course Content I-5
iii
IT Bangla Ltd
iv
IT Bangla Ltd
v
IT Bangla Ltd
Abd Modifying the Appearance of a Text Item: Font and Color Properties 7-8
Modifying the Appearance of a Text Item: Prompts 7-9
Associating Text with an Item Prompt 7-10
Controlling the Data of a Text Item 7-11
Controlling the Data of a Text Item: Format 7-12
Controlling the Data of a Text Item: Values 7-13
Controlling the Data of a Text Item: Copy Value from Item 7-15
Controlling the Data of a Text Item: Synchronize with Item 7-16
Altering Navigational Behavior of Text Items 7-17
Enhancing the Relationship Between Text Item and Database 7-18
Adding Functionality to a Text Item 7-19
Adding Functionality to a Text Item: Conceal Data Property 7-20
Adding Functionality to a Text Item: Keyboard Navigable and Enabled 7-21
Adding Functionality to a Text Item: Multi-line Text Items 7-22
vi
IT Bangla Ltd
Objectives 8-2
Overview of LOVs and Editors 8-3
LOVs and Record Groups 8-6
Creating an LOV Manually 8-8
Creating an LOV with the LOV Wizard: SQL Query Page 8-9
Creating an LOV with the LOV Wizard: Column Selection Page 8-10
Creating an LOV with the LOV Wizard: Column Properties Page 8-11
Creating an LOV with the LOV Wizard: Display Page 8-12
Creating an LOV with the LOV Wizard: Advanced Properties Page 8-13 a ble
er
Creating an LOV with the LOV Wizard: Assign to Item Page 8-14
an sf
LOV Properties 8-15 - t r
on
Setting LOV Properties 8-16
LOVs: Column Mapping 8-17 s an
Defining an Editor 8-19 ) ha deฺ
c o m Gui
ailฺ dent
Setting Editor Properties 8-20
m
Associating an Editor with a Text Item 8-21
Summary 8-22
e l @g is Stu
f i ฺ rub se th
Practice 8: Overview 8-23
( k a ou
9 Creating a i
f seInput
Additional
t Items
K
el lic9-2en
Objectives
H
h
d ula Input Items: Overview 9-3
Ab Check Boxes: Overview 9-4
Creating a Check Box 9-5
Converting Existing Item to Check Box 9-6
Creating a Check Box in the Layout Editor 9-7
Setting Check Box Properties 9-8
Check Box Mapping of Other Values 9-10
List Items: Overview 9-11
Creating a List Item 9-13
Converting Existing Item to List Item 9-14
Creating a List Item in the Layout Editor 9-15
Setting List Item Properties 9-16
List Item Mapping of Other Values 9-17
Radio Groups: Overview 9-18
Creating a Radio Group 9-19
vii
IT Bangla Ltd
viii
IT Bangla Ltd
a ble
12 Working with Other Canvas Types
er
Objectives 12-2
an sf
Overview of Canvas Types 12-3 - t r
on
Stacked Canvas 12-4
s an
Creating a Stacked Canvas 12-6
) ha deฺ
Setting Stacked Canvas Properties 12-8
c o m Gui
Toolbar Canvas 12-9
m ailฺ dent
@g is Stu
MDI Toolbar 12-10
e l
Creating a Toolbar Canvas 12-11
i ฺ rub se th
Setting Toolbar Properties 12-12
f
( k a ou
Tab Canvas 12-13
a i
f se t
K
Creating a Tab Canvas 12-14
el licen
h HCreating a Tab Canvas in the Object Navigator 12-15
u la Creating a Tab Canvas in the Layout Editor 12-16
b d
A Setting Tab Canvas, Tab Page, and Item Properties 12-17
Placing Items on a Tab Canvas 12-18
Summary 12-19
Practice 12: Overview 12-21
13 Introduction to Triggers
Objectives 13-2
Trigger: Overview 13-3
Grouping Triggers into Categories 13-4
Defining Trigger Components 13-6
Trigger Type 13-7
Trigger Code 13-9
Trigger Scope 13-10
ix
IT Bangla Ltd
14 Producing Triggers
Objectives 14-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
x
IT Bangla Ltd
Summary 15-22
Practice 15: Overview 15-23
xi
IT Bangla Ltd
18 Query Triggers
Objectives 18-2
Query Processing: Overview 18-3
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
20 Navigation
Objectives 20-2
Navigation: Overview 20-3
Internal Navigation 20-5
Using Object Properties to Control Navigation 20-7
Mouse Navigate Property 20-9
Writing Navigation Triggers 20-10
Navigation Triggers 20-11
When-New-<object>-Instance Triggers 20-12
xii
IT Bangla Ltd
21 Transaction Processing
Objectives 21-2
Transaction Processing: Overview 21-3
Commit Sequence of Events 21-6
Characteristics of Commit Triggers 21-8
Common Uses for Commit Triggers 21-10 a ble
er
Life of an Update 21-12
an sf
Delete Validation 21-14 - t r
on
Assigning Sequence Numbers 21-16
Keeping an Audit Trail 21-18 s an
Testing the Results of Trigger DML 21-19 ) ha deฺ
c o m Gui
m ailฺ dent
DML Statements Issued During Commit Processing 21-21
Overriding Default Transaction Processing 21-23
l @g is Stu
Running Against Data Sources Other than Oracle 21-25
e
ฺ rub se th
Getting and Setting the Commit Status 21-27
f i
( k a ou
Array DML 21-31
a i
f se t
Effect of Array DML on Transactional Triggers 21-32
K
el licen
HImplementing Array DML 21-33
la h Summary 21-34
b d u Practice 21: Overview 21-38
A
22 Writing Flexible Code
Objectives 22-2
What Is Flexible Code? 22-3
Using System Variables for Current Context 22-4
System Status Variables 22-6
GET_<object>_PROPERTY Built-Ins 22-7
SET_<object>_PROPERTY Built-Ins 22-9
Referencing Objects by Internal ID 22-11
FIND_ Built-Ins 22-12
Using Object IDs 22-13
Increasing the Scope of Object IDs 22-15
xiii
IT Bangla Ltd
Objectives 23-2
Benefits of Reusable Objects and Code 23-3
Copying and Subclassing Objects and Code 23-5
Subclassing 23-6
What Are Property Classes? 23-8
Creating a Property Class 23-9
Inheriting from a Property Class 23-11
What Are Object Groups? 23-13
Creating and Using Object Groups 23-14 a ble
er
What Are Object Libraries? 23-16
an sf
Benefits of the Object Library 23-18 - t r
on
Working with Object Libraries 23-19
What Is a SmartClass? 23-20 s an
Working with SmartClasses 23-21 ) ha deฺ
c o m Gui
ailฺ dent
Reusing PL/SQL 23-22
What Are PL/SQL Libraries? 23-24 m
Writing Code for Libraries 23-25
e l @g is Stu
f i ฺ rub se th
Creating Library Program Units 23-26
k a ou
Attach Library Dialog Box 23-27
(
a i
f se t
Calls and Searches 23-28
K
el licen
Summary 23-30
H
la h
Practice 23: Overview 23-32
b d u
A 24 Using WebUtil to Interact with the Client
Objectives 24-2
WebUtil: Overview 24-3
Benefits of the WebUtil Utility 24-4
Integrating WebUtil into a Form 24-11
When to Use the WebUtil Functionality 24-13
Interacting with the Client 24-14
Example: Opening a File Dialog Box on the Client 24-15
Example: Reading an Image File into Forms from the Client 24-16
Example: Writing Text Files on the Client 24-17
Example: Executing Operating System Commands on the Client 24-18
Example: Performing OLE Automation on the Client 24-19
Example: Obtaining Environment Information About the Client 24-22
xiv
IT Bangla Ltd
Summary 24-23
Practice 24: Overview 24-24
xv
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Preface
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Profile
Preface - 3
IT Bangla Ltd
Related Publications
Oracle publications
Title Part Number
Oracle Forms Developer, Release 6i:
Getting Started (Windows 95/NT) A73154-01
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Additional publications
Release notes: <ORACLE_HOME\doc\welcome\release_notes\chap_forms.htm
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Preface - 4
IT Bangla Ltd
Typographic Conventions
Typographic conventions in text
Uppercase SQL column names, Use the SELECT command to view information
commands, functions, stored in the LAST_NAME
schemas, table names column of the EMP table.
Preface - 5
IT Bangla Ltd
Typographic Conventions (continued)
Typographic conventions in text (continued)
a i
f se t
Uppercase
e K e n
l SQL commands SELECT userid
ic
h H and lfunctions FROM emp;
l a
du
Ab
Preface - 6
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Introduction
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
a n sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Introduction a fi se t
l K en
Overview He l i c
u
This l ah introduces you to the Oracle Forms Developer 10g: Build Internet
lesson
d
AbApplications Ed 2 course:
• The objectives that the course intends to meet
• The topics that it covers
• How the topics are structured over the duration of the course
Course Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Course Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Course Content
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Day 1
• Lesson 1: Introduction to Oracle Forms Developer
and Oracle Forms Services
• Lesson 2: Running a Forms Developer Application
• Lesson 3: Working in the Forms Developer
Environment
• Lesson 4: Creating a Basic Form Module
r a ble
• Lesson 5: Creating a Master-Detail Form n s fe
- t r a
• Lesson 6: Working with Data Blocks and n on
Frames
s a
a
) h ideฺ
m
co t Gu
i l ฺ
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Course Content af i e t
K s
entopics that are covered in this course, and the usual sequence of
el showlicthe
The lesson Htitles
l
lessons.
u ahHowever, the daily schedule is an estimate, and may vary for each class.
d
Ab
Course Content
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Day 2
• Lesson 7: Working with Text Items
• Lesson 8: Creating LOVs and Editors
• Lesson 9: Creating Additional Input Items
• Lesson 10: Creating Noninput Items
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
Course Content
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Day 3
• Lesson 11: Creating Windows and Content
Canvases
• Lesson 12: Working with Other Canvas Types
• Lesson 13: Introduction to Triggers
• Lesson 14: Producing Triggers
• Lesson 15: Debugging Triggers a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
Course Content
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Day 4
• Lesson 16: Adding Functionality to Items
• Lesson 17: Run-time Messages and Alerts
• Lesson 18: Query Triggers
• Lesson 19: Validation
• Lesson 20: Navigation
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
Course Content
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Day 5
• Lesson 21: Transaction Processing
• Lesson 22: Writing Flexible Code
• Lesson 23: Sharing Objects and Code
• Lesson 24: Using WebUtil to Interact with the
Client
• Lesson 25: Introducing Multiple Form Applications a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Introduction a i
f se t
l K en
Overview He l i c
l ah teaches you how to build effective and professional applications using Oracle
Thisucourse
bd Developer.
AForms
This lesson identifies the key features of Oracle Application Server 10g, Oracle Developer
Suite 10g, Oracle Forms Services, Oracle Forms Developer, and the course application model
and contents.
There are many terms used in this course that may be unfamiliar to you. For a glossary
containing definitions of many of these terms, see http://www.oracle.com/glossary.
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
fi se t
Internet ComputingaSolutions
l K en and deployment options for Internet computing. Different types
Oracle offersHaerange lof
i ctools
l ah and applications require different toolsets.
of developers
u
d
Ab• Enterprise application developers need a declarative model-based approach. Oracle
Designer and Oracle Forms Developer provide this solution, as do the later versions of
JDeveloper. This course focuses on how you can use Oracle Forms Developer to rapidly
build scalable, high-performance applications for the Internet and then deploy the
applications with Oracle Forms Services.
• Component developers need different tools and methods. For these developers, Java is
the language of choice. Oracle’s solution is JDeveloper.
• For Web site developers and content publishers who want to build self-service dynamic
Hypertext Markup Language (HTML) applications for Web sites, Oracle Portal provides
an easy-to-use development environment that resides entirely inside an Oracle database.
Portal provides a browser-based environment from development through deployment of
an application.
• For Management Information System (MIS) developers and end users, there is the
Oracle Business Intelligence toolset. Oracle Reports Developer, Oracle Reports
Services, Oracle Discoverer, and Oracle Express provide the whole range for reporting,
analysis, and trending facilities.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Oracle Enterprise Grid a fi Computing
s e t
K en new capabilities required to power grid computing, Oracle
eofl the significant
In recognition
H l i c
l
has named
u ah its new technology products Oracle 10g, the first major name change since adding
bd capabilities to Oracle8i. Oracle 10g provides the first complete, integrated software
AInternet
infrastructure to power grid computing through every element of the grid—storage, databases,
application servers, and applications:
• Oracle Database 10g provides:
- Real Application Clusters (RAC), which enables a single database to run across
multiple clustered nodes in a grid and features Cluster Workload Management to
quickly respond to fluctuations in grid workloads
- Automatic Storage Management (ASM), which abstracts the details of managing
storage to provide sophisticated data provisioning and enables DBAs to manage
disk groups rather than many database files
- Information provisioning, providing access to information when and where it is
needed
- A self-managing database, thus reducing the maintenance and tuning tasks of
DBAs
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Oracle Application a fi s10g
Server e tArchitecture
K
el Server en
Oracle Application
h H l i c 10g has a layered architecture including the following services:
d u la
• Communication Services: Communication management for a variety of protocols
Ab • Application Services: J2EE Container that provides a common run-time environment
for applications developed as JSPs, Servlets, EJBs, and Web Services
• System Services: A common set of run-time services that are necessary for J2EE
Applications and Web Services, such as request dispatch and scheduling, resource
management, resource pooling, clustering, fault monitoring, transaction management,
and messaging
• Management Services: A common set of systems management services to monitor the
status, performance, and faults of the system; to monitor resource consumption and
usage; to manage a single instance or cluster of instances; to centrally administer
security for users and applications; and to provide a comprehensive directory service
framework to manage users
• Connectivity Services: Provide connectivity to a variety of systems
• Solutions: A comprehensive set of solutions, all built on the infrastructure described
above including Enterprise Portals, Enterprise Integration, Business Intelligence,
Wireless, and ISV Solutions
• Integration and Commerce Services: Provide ability to build enterprise portals,
integrate systems with each other, automate business processes, and serve personalized
recommendations to users
Oracle Forms Developer 10g: Build Internet Applications 1-8
IT Bangla Ltd
a ble
er
an sf
- t r
on
s an
Oracle Application Server ) h
a eฺ
Forms Services c o m Guid
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Oracle Application a fi s10g
Server e tComponents
K en Application Server, you can:
el loficOracle
With the components
H
l ah and analyze business intelligence: Clickstream, Personalization, Reports
• Extract
u
d
Ab• Services, Discoverer
Integrate your business: InterConnect, Workflow, Unified Messaging, Internet File
System
• Create personalized portals: Oracle Portal
• Deploy dynamic Web applications: XDK, Web Services, Forms Services, OC4J,
HTTP Server
• Manage and secure your Web infrastructure: Enterprise Manager, Security, Internet
Directory
a ble
er
an sf
A component of Oracle - t r
Application Server that on
deploys Forms applications s an
to Java clients in a Web ) ha deฺServer
Oracle Application
o m Forms u i Services
environment c G
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Oracle Forms Services:a fi Overview
s e t
K
el liciseancomponent of Oracle Application Server for delivering Oracle
Oracle FormsH Services
u ah
FormslDeveloper applications to the Internet. Oracle Forms Services automatically provides
d
b infrastructure that is needed to successfully deliver applications on the Internet through
Athe
built-in services and optimizations.
Oracle Forms Services uses a three-tier architecture to deploy database applications:
• The client tier contains the Web browser, where the application is displayed and used.
• The middle tier is the application server, where the application logic and server software
reside.
• The database tier is the database server, where enterprise data is stored.
Forms Listener
Servlet
Forms Servlet
Application
a b le
logic layer er
an sf
Data manager/
- t r
PL/SQL engine on
JRE
s an
Java applet
File containing m)
ha deฺ
o u i
c G
application code
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Forms Services Architecturefi se t
l K
econsists enfour major components: the Java client (Forms Client), the Forms
Forms Services
h H l i cof
l
Listener
u aServlet, the Forms Servlet, and the Forms Runtime Engine. You learn about these
b d
Acomponents in the lesson titled “Running a Forms Developer Application.”
When a user runs a forms session over the Web, a thin, Java-based Forms applet is
dynamically downloaded from the application server and automatically cached on the client
computer. The same Java applet code can be used for any form, regardless of size and
complexity.
Although Forms Services uses a Java applet for displaying the form on the client browser, the
developer does not need to know Java in order to develop and deploy a Forms application.
Application Development
• OWB
• JDeveloper
• Discoverer
• Forms
• Reports
• Designer le
• SCM r a b
sf e
t r an
on -
s an
Business Intelligence
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se Suite
Benefits of Oracle Developer t 10g
K
el Suite: en
Oracle Developer
H l i c
l ah the power of Oracle application development tools and Oracle Business
• Combines
u
d Intelligence tools
Ab• Provides a standards-based, Java and XML integrated development environment and
supports the full application development life cycle
• Provides flexible and scalable solutions for data warehousing and business intelligence
• Is optimized for Oracle Database and Oracle Application Server 10g
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Application Developmentfi Features
s e t of Oracle Developer Suite 10g
K en the following features for application development:
el Suitelicprovides
Oracle Developer
H
l ah
• Modeling:
u Oracle Designer provides visual modeling, reverse engineering, and code
d
Ab generation tools. Oracle Developer Suite also supports Unified Modeling Language
(UML) by utilizing visual tools for Activity and Class modeling within the JDeveloper
component.
• Rapid Application Development (RAD): RAD capabilities in Oracle Developer Suite
include integrated builders, reentrant wizards, live previewers, and property inspectors.
The JDeveloper component provides additional productivity through Application
Development Framework, a built-in J2EE framework.
• J2EE and Web Services: Oracle Developer Suite supports the latest J2EE 1.4 APIs,
including Enterprise JavaBeans (EJB), Java Server Pages (JSP), and Servlets. Web
services support Simple Object Access Protocol (SOAP), Web Service Description
Language (WSDL), and Universal Description, Discovery, and Integration (UDDI).
• Team Support: Oracle Software Configuration Management provides versioning,
dependency management, and impact analysis for all objects and file types.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Business intelligence fiFeatures
s e t of Oracle Developer Suite 10g
K enprovides the following business intelligence features:
el Suitelic10g
Oracle Developer
H
l ah transformation, and load (ETL): Oracle Warehouse Builder provides a
• Extract,
u
d
Ab graphical interface for mapping and transformation. It also provides an extensible
framework for integrating a diverse set of data sources and integration with business
intelligence tools.
• End user query and analysis: With Oracle Discoverer Administrator, you can create
and maintain a business-oriented view of the data that supports the Discoverer client
tools: Discoverer Plus and Discoverer Viewer (in Oracle Application Server), and
Discoverer Desktop (in Oracle Developer Suite).
• Enterprise Reporting: Oracle Reports Developer enables the developer to access any
data, to publish it in any format, and to send it anywhere. Supported formats include
HTML with CSS, PDF, RTF, Postscript, and XML.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
What Is Oracle Forms a fi Developer?
s e t
K
el liceisna productive development environment for building enterprise-
Oracle Forms H Developer
l ah database applications for the Internet. Oracle Forms Developer provides a set
class, scalable
u
d
Aofb tools that enable business developers to easily and quickly construct sophisticated database
forms and business logic with a minimum effort.
Oracle Forms Developer uses powerful declarative capabilities to rapidly create applications
from database definitions that leverage the tight integration with the Oracle database. The
toolset leverages Java technology, promotes reuse, and is designed to allow developers to
declaratively build rich user interfaces. Developer productivity is further increased through a
single integrated development environment that enables distributed debugging across all tiers,
utilizing the same PL/SQL language for both server and client.
Oracle Forms Developer’s tight integration with Oracle Designer enables you to use a
productive model-driven development approach. Oracle Forms Developer applications can be
automatically generated from business requirements designed in the Oracle Designer
modeling environment. These models are stored in Oracle Repository. Code-level changes
made within the Oracle Forms Developer environment can be automatically reverse
engineered back into the models, preserving the integrity between the models and the
application.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Oracle Forms Developer fi 10g: s e t Features
Key
K
elapplicationen development: You can create and modify applications with little
Tools for rapid
H l i c
l ah Productivity is enhanced with wizard-based rapid application development and
or no code.
u
bd commands that perform common functions.
Abuilt-in
Application partitioning: You can place individual PL/SQL program units on the database
server or in the application, whichever is most suitable. You can drag objects between
modules and the database server.
Flexible source control: Oracle Software Configuration Manager (SCM) is integrated
directly in Forms Developer to provide source control options, such as checkin and checkout
capability, versioning, diff and merge utilities, and impact analysis.
Extended scalability: The multitiered architecture enables you to scale applications from a
single user to tens of thousands of users, with no changes to the application. You can use
server functionality, such as array DML, database cursors, or bind variables, to improve
scalability.
Object reuse: Oracle Forms Developer offers an inheritance model that facilitates the
inheritance of attributes and code from one object to another and from one application to
another, through subclassing and object libraries.
Application
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Introducing the Course fi Application
s e t
l K
eSupply en
Summit Office
H l i cSchema
The u l ah table diagram shows the tables that are used throughout the course to build the
simplified
bd application. These tables are used in other Oracle University courses as well.
AForms
Summit Office Supply is a company that sells office products to customers. Summit has a
number of employees in several departments. Some employees are sales representatives who
have a relationship with specific customers.
Customers place orders. Each order consists of one or more line items. Each line item
represents a product.
Many products have an associated image, in the form of an image file.
The company products are stored in a number of warehouses. The contents of the warehouses
are managed in the inventory.
Summit Application
CV_Customer canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
CUSTOMERS Customers
CUSTOMERS block
table form
CV_Order Canvas
ORDERS
ORDERS block
table
Orders form
ORDER_ITEMS block
ORDER_ITEMS
table a b le
CV_Inventory canvas er
an sf
INVENTORIES block - t r
on
s an
INVENTORIES ) ha deฺ
c
table o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Summit Office Supply a fi Application
s e t
l K n
The followingH eexample
l i ofea Forms Builder application will familiarize you with the main run-
c
l ah of the product. You will also build your own version of this application during
time facilities
u
bdpractices in this course.
Athe
The Summit company produces a range of office supplies that they sell to businesses and
individuals (their customers). The Summit application is an order-entry system that maintains
customer details, their orders, and the available stock (inventory).
The application consists of two main forms:
• Customers form: The Customers form facilitates queries on existing customers and the
insertion, update, or deletion of customer records. When a customer is selected, the user
can open the Orders form to enter or view orders for that customer. The form consists of
a single block, the CUSTOMERS block, which is a single record block whose base table
is Customers.
The base table is Orders, but the block also displays associated information from
other tables, such as the name of the customer.
- ORDER_ITEMS block: The ORDER_ITEMS block is the related detail block for
an order, showing its line items and the products ordered. This is a multirecord
block whose items are on the same canvas as those in the ORDERS block. The base
table of the ORDER_ITEMS block is Order_Items, but the block displays
information from other tables, such as the product description.
- INVENTORIES block: The INVENTORIES block is a multirecord block showing
warehouse stock for a product. Its items are on a separate canvas, which is
assigned to its own window. This block is linked to the current product in the rab
le
ORDER_ITEMS block, but the two blocks can operate independently. nsfe
- t r a
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
K n computing power available on demand, without regard to
elseekslitocemake
Grid computing
H
ahdata or application resides or which computer processes the request. Oracle 10g
where lthe
u
bd (Database, Application Server, and Enterprise Manager Grid Control) provide the
Aproducts
software infrastructure to power enterprise grid computing.
Oracle Application Server provides a variety of services for building and deploying Web
applications, including Oracle HTTP Server (OHS), Oracle Containers for J2EE (OC4J),
Reports Services, and Forms Services.
Oracle Developer Suite includes components for application development (JDeveloper,
Designer, Software Configuration Manager, and Forms Developer) and for business
intelligence (Warehouse Builder, Discoverer, and Reports).
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary (continued) a i
f se t
K n
el licaecomponent
Oracle Forms
H Services, of Oracle Application Server 10g, provides for the Web
h
la of Forms applications with a rich Java user interface. It uses the same generic
deployment
d u
b for any form.
Aapplet
The components of Oracle Forms Services all play a role in running an application. These
components are the Forms Client (Java applet), the Forms Servlet, the Forms Listener Servlet,
and the Forms Runtime Engine.
Oracle Forms Developer is the component of Oracle Developer Suite 10g that enables you to
develop Forms applications. Benefits of Oracle Forms Developer include:
• Rapid application development: Create and modify applications with little or no code.
• Application partitioning: Drag objects between modules and the database server.
• Flexible source control: Integration with Software Configuration Manager (SCM)
• Extended scalability: Use of server functionality such as array DML, database cursors,
or bind variables
• Object reuse: Subclassing, object libraries
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Running a Forms
Developer Application
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Introduction a i
f se t
K en
Overview Hel i c
l
l ah that you understand the environment of the form operator before designing and
It is essential
u
bd your own applications. In this lesson, you run an existing application on the Web in
Abuilding
order to familiarize yourself with the run-time interface of Oracle Forms Developer.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
fi se t
Testing a Form withaOC4J
K
el licen
What Is OC4J?
H
Oracle l ah
b d container thatServer
u
(J2EE)
Application Containers for J2EE (OC4J) is Oracle’s Java 2 Enterprise Edition
executes on any Java Virtual Machine (JVM), which is the Java interpreter
A
that is provided on each operating system and hardware platform. OC4J is implemented
completely in Java, making it lightweight and easy to install. At the same time, it provides
complete support for J2EE applications, including servlets, Enterprise JavaBeans, JavaServer
Pages, and so on.
OC4J is ideally suited to run Forms applications. It is included in Oracle Developer Suite to
enable you to test your applications, if desired, on the same machine where you are running
Forms Builder. That is, you do not need to install Oracle Application Server to test your
applications.
Running a Form
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Browser URL
Java applet
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Running a Form a fi se t
K en to the Web is implemented by the three-tier architecture of Oracle
el applications
Deploying Forms
H l i c
l ah Server. Application logic and the Forms Runtime Engine reside on the middle-tier
Application
u
bd
Aapplication server. All trigger processing occurs on database and application servers, whereas
user interface processing occurs on the Forms Client. End users can run Forms Developer
applications in a Web browser.
Users request an application in their Web browsers by entering a URL that points to the
application. Forms Services then generates an HTML file that downloads a Java applet to the
client machine. This small applet is capable of displaying the user interface of any form, while
the application logic is executed on the middle tier.
How do I
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
access this
application? http://summit.com:8889/forms/frmservlet?form=customers.fmx&userid=pg
a ble
er
a n sf
- t r
on
an
http://summit.com:8889/forms/frmservlet
?form=d<formname>.fmx s
ha deฺ
)
&userid=<username>/<password>@<database>
m Gui
c o
ailฺ ent
&buffer_records=NO&debug_messages=NO&array=YES
&query_only=NO
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Running a Form: Browser a i
f se t
K en must have the following format:
el anlapplication
The URL to H invoke i c
l ah
http://host.domain[:port]/forms
u servlet or html file[parameters] (optional portions of URL
d
Ab
enclosed in brackets)
Summit’s URL consists of the following components:
Protocol http
Host and domain summit.com
Port for HTTP Server 80 default for HTTP Server
or OC4J 8889 default for OC4J
Forms Servlet Alias /forms/frmservlet
or static HTML file
Parameters: This section begins form=customers.fmx
with “?”; parameters separated by userid=<username>/<password>@<database>
“&” buffer_records=NO
(can be specified in the URL or debug_messages=NO
....
taken from configuration file).
( k a ou
i
f se t
Starting a Run-TimeaSession
K
el session n
einvolves
Starting a run-time
h H l i c the following steps:
d u la user accesses the URL that indicates that a Forms application should be run.
1. The
Ab contacts
2. The Oracle HTTP Server or OC4J receives an HTTP request from the browser client and
the Forms Servlet.
3. The Forms Servlet dynamically creates an HTML page containing all the information to
start the Forms session.
( k a ou
Starting a Run-TimeaSession i
f se(continued)t
K en or OC4J downloads a generic applet to the client after checking
elHTTPlicServer
4. The Oracle
H
u l ahit has not already been downloaded. The client caches the applet so that it can run
that
d future Forms applications without downloading it again.
Ab5. The client applet contacts the Forms Listener Servlet to start the session. The Forms
Listener Servlet starts an instance of the Forms Runtime Engine on the Forms Server
(middle tier). If included in the HTML file, Forms Runtime command-line parameters
(such as form name, user ID and password, database SID, and so on) and any user-defined
Forms Builder parameters are passed to the process by the Forms Listener Servlet.
6. The Forms Listener Servlet establishes a connection with the Forms Runtime Engine,
which connects to the database if needed and loads application executable files.
( k a ou
i
f se(continued)
Starting a Run-TimeaSession t
K en the user interface of the application in the main window of the
elappletlidisplays
7. The Forms
H c
u l ah Web browser.
user’s
d The Forms Listener Servlet, working through OC4J or the HTTP Server, manages
Ab8. communication between the Forms applet and the Forms Runtime Engine.
Technical Note
For more information about Oracle Forms Listener Servlet, refer to the Oracle Application
Server Forms 10g (9.0.4) Technical Overview white paper.
Forms Servlet
http://summit.com:8889/forms/frmservlet?form=customer
Web server
Static HTML files
formsweb.cfg HTTP Server or OC4J
basejini.html
Forms services
a ble
URL PARAMETERS:
er
?form=customers.fmx
Forms Client
an sf
Base HTML files n-tr
&userid=un/pw@db
&buffer_records=NO
...
Forms Servlet no
s a Servlet
Forms Listener
Dynamic a
h deฺEngine
HTML file is m) Runtime
Forms
co t Gu
i
created. i l ฺ
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Forms Servlet a i
f se t
K enservlet that creates a dynamic HTML file by merging information
el is aliJava
The Forms Servlet
h H c
from the
u l afollowing sources:
d
Ab• The Forms base HTML
• The Forms Web configuration file
file
• The application’s URL parameters
Forms Client
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an 2
5 ) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
What You See at Run a i
fTime e t
K
elwill see s
enfollowing components:
At run time, Hyou
l i c the
l ah window
1. Browser
u
d
Ab2.3. Java applet (contained within browser window)
Default menu (contained within applet)
4. Menu toolbar (contained within applet)
5. Console (contained within applet)
What Is the Default Menu?
The default menu, which is part of all Oracle Forms Developer applications, is an alternative to
keystroke operations. You can replace or customize the Default menu to introduce your own
functionality into a form module.
What Is the Menu Toolbar?
The menu toolbar contains buttons corresponding to menu items. At run time, it appears above
any user-defined toolbars. It executes the same code as menu items, and it is a shortcut to menu
commands that does not duplicate code or effort.
module
Indicator Description
Record: n/m The nth record retrieved and displayed so far, out of m number of
total records that can be retrieved by the query.
Until the last record is fetched, m displays as “?”; after that, it
displays the number corresponding to the last record.
Enter-Query The current block is in Enter Query mode and no records have been
retrieved.
List of Values A list of values (LOV) is associated with the current item. a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Identifying the Dataa fi se t
Elements
K
el may n different kinds of data elements:
econtain
A Forms application
H l i c
l ah
1. Prompts
u
d Text items
Ab2.3. Check boxes
4. Boilerplate graphics
5. Boilerplate text
6. Display items
7. List items
8. Push buttons
9. Image items
10. Radio groups
Not pictured:
• Hierarchical tree items
• Chart items
• Custom items
Methods of navigation:
• Default menu
• Menu toolbar
• Mouse
• Buttons
• Function keys
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Navigating a Formsa fi se t
Application
K
el licen
Default MenuH
l ah menu is automatically available in a form, unless it is disabled or replaced with a
The Default
u
bd
Acustomized menu. Select options from the menu by using the mouse or function keys. At run
time, use the menu to perform the following tasks:
• Move the cursor and navigate between data blocks, records, and items.
• Save or clear all changes.
• Execute queries.
• Insert new records or delete existing records.
• Invoke Help.
Menu Toolbar
You can use the Default menu toolbar buttons to perform the following operations, which are
also available through the Default menu:
• Save all changes.
• Exit the form.
• Execute queries.
• Navigate between data blocks or records.
actions:
• Move the cursor.
• Select from a menu.
• Select from an LOV.
• Select or clear a check box.
• Select a button, including an option button.
• Switch to an open window.
• Respond to an alert.
• Scroll records or lines by using a data block or item scroll bar.
• Manipulate a custom item.
r a ble
e
Buttons nsf
ra
n -t with the
Web applications often use buttons as a means of navigation. You can click buttons
o
mouse. Use buttons to perform the following tasks:
s an
• Move input focus.
) ha deฺ
• Display a list of values.
c o m Gui
• Invoke an editor.
a ilฺ ent
• Invoke another window. m
g Stud
• Commit data. l @
e his
u b
• Issue a query.
a f iฺr use t
• Perform calculations.(k
• Exit the form.Kaf
i e to
el licen s
Function KeysH
u l ahto navigating with the mouse, you can move from item to item in sequence with
In addition
bd keys. Use function keys to perform the following tasks:
Afunction
• Navigate between data blocks, records, and items.
• Execute queries.
• Insert new records or delete existing ones.
• Invoke Help.
To view a list of keys and the functions they perform, select Help > Keys, or press [Ctrl] + K.
Retrieving Data
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
A B C D A B C D
1 1
2 2
3
4
A B C D A B C D
1 1
r a ble
2 2
n s fe
3 3
- t r a
4 4 on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Retrieving Data a fi se t
K
el module ento retrieve information from the database without knowing any SQL
You can use H
h
a form
l i c
syntax.la
However, if you are an experienced SQL user, you may want to supplement Oracle
d u
Ab
Forms Developer
of queries:
default processing with your own SQL predicates. There are two general types
• Invoke by:
– Entering
:<variable_name >
&<variable_name >
:
&
– Executing query
a b le
er
• Used to write:
an sf
– Complex search conditions - t r
on
– Queries with OR predicates
s an
– The ORDER BY clause ) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
b© 2006, Oracle.
u
Copyright
ฺ r t h
( k afi o use
Using the Query/Where a fi Dialog
s e tBox
K
el dialog n you can enter complex search criteria by using raw SQL. To use
ebox,
In the Query/Where
H l i c
l ah
the Query/Where
u dialog box effectively requires knowledge of SQL. Use Query/Where to
d
Ab
perform the following tasks:
• Write complex search conditions.
• Write queries with OR predicates.
• Order the result of a query.
Forms Builder logically uses the AND operator to append the Query/Where conditions to any
other search criteria (including those imposed by the form designer) and constructs a SELECT
statement. The Query/Where dialog box does not work in an item whose name differs from the
name of its corresponding database column.
To improve security, Forms 10.1.2.0.2 introduced a new run-time environment variable,
FORMS_RESTRICT_ENTER_QUERY, that is initially set to TRUE, which makes it impossible
to invoke the Query/Where dialog box. You must set this environment variable to FALSE (or
comment out the line that sets it to TRUE) to enable the use of the Query/Where dialog box. The
lesson titled “Working in the Forms Developer Environment” discusses environment variables
and how to set them.
2. Enter a colon (:) or an ampersand (&) followed by a unique character variable name in one
or more items.
3. Perform one of the following: Select Query > Execute, click Execute Query, or press the
appropriate function key.
Note: You can select Query > Count Hits if you simply want to know how many records
will match your criteria.
The Query/Where dialog box is displayed.
4. Enter the search criteria by using variables, SQL, and logical operators. Click OK.
Note: To perform a query without any variables, enter only the colon (:) or ampersand (&)
and execute the query. Doing so also displays the Query/Where dialog box.
r a ble
If you enter an ORDER BY at run time, it overrides any ordering defined by the designer.sfe
Example - t r an
onID (:O) between
1. To restrict the query to orders with a Sales Rep ID (:S) of 11 or an Order
n
100 and 200, enter the following in the Query/Where dialog box:sa
ha deฺ
:S = 11 OR :O between 100 and 200 )
m in the i
c o
2. To sort the data by Sales rep ID (:S), enter the following G uQuery/Where dialog box:
a ilฺ ent
ORDER BY :S
g m tud
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
H
u l ah
A bd
Memory
Deletes
Updates
Inserts
Form module
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Inserting, Updating,aand fi Deleting
s e t Records
l K enmodule, you are in Normal mode. This means that Forms Builder
Upon enteringH aetypical i c
form
regardsla
anything
l
h that you enter into a blank record as an insert and anything that you enter over
d u
Aanb existing record as an update.
How to Insert a Record
To insert a record, perform the following steps:
1. Ensure that you have the cursor positioned on a blank record by performing one of the
following steps:
- Scroll down until you find a blank record (always the last in the block).
- Select Record > Insert.
- Click Insert Record (green +).
- Press the appropriate function key.
2. Enter the data into the relevant items.
4. Scroll through the records, and stop at the record that is to be updated.
5. Update the record.
How to Delete a Record
To delete a record, perform the following steps:
1. Select Query > Enter.
2. Enter the search criteria to retrieve the appropriate record.
3. Select Query > Execute to retrieve all records that satisfy your specific search criteria.
4. Scroll through the records, and stop at the record that is to be deleted. Delete the record by
performing one of the following actions:
- Select Record > Remove to clear the record and mark it for deletion. r a ble
- Click Remove Record (red X) to clear the record and mark it for deletion. n s fe
- Press the appropriate function key. - t r a
no n
s ฺa
h a
o m )
u ide
a ilฺc ent G
g m tud
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Memory To commit or
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
or
an sf
- t
Toolbar
n r
a no
h a s ฺ
o m )
u ide
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Making Inserts, Updates,a i
f and e t
Deletes Permanent
l K
e updates, n s
e or deletes permanent, you must save (commit) them to the
To make anyH inserts,
l i c
l
database.
u ahTo do this, perform one of the following actions:
d
Ab•• Select Action > Save.
Click Save on the Menu toolbar.
Discarding Inserts, Updates, and Deletes
To discard any inserts, updates, or deletes, you must clear the records (roll back) instead of
saving. Perform a rollback by selecting Action > Clear All.
Exiting a Run-Time Session
You exit the run-time session by performing one of the following actions:
• Select Action > Exit.
• Click Exit.
• Press the appropriate function key.
Note: By default, you cannot exit the form while you have unsaved updates, inserts, or deletes.
You need to either save or undo the changes before you can exit.
Displaying Errors
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Displaying Errors afi e t
K s
en on the message line while you are operating a Forms application,
el is displayed
If an Oracle H
error
l i c
h view the underlying SQL code by selecting Help > Display Error.
l
then you
u acan
bd
AExample
The following is the SQL statement in error and its corresponding error:
SELECT order_id, order_date, order_mode, order_status,
customer_id, sales_rep_id
FROM orders
WHERE (order_id in ('a','b'))
ORA-01722: invalid number
Note: Selecting Help > Display Error displays only those errors where the error on the message
line is preceded by ORACLE error.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
K
el lithe n
eoperator
This lesson introduced
h H c interface of Forms Builder. The following concepts were
coveredlain this lesson:
duStarting OC4J on the development machine
Ab•• The run-time environment for Forms:
- Running a form in a browser
- Starting a run-time session: The Forms Servlet, the Forms Client, and the Forms
Listener Servlet
• The data elements of a form
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Summary (continued) a fi se t
l K
eupdating, en deleting records
• Inserting,
H l i cand
l ah or clearing changes
• Saving
u
d
Ab• Displaying database errors
Practice 2: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Practice 2
1. Start an instance of OC4J.
2. Invoke Internet Explorer and enter the following URL:
http://<machine>:<port>/forms/frmservlet?form=customers.fmx
Your instructor will tell you the machine name and port number to use.
3. Select Help > Keys from the menu.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
4. Click OK to close the Keys window. Browse through the records that were returned by the
unrestricted query that executed automatically when the form started.
5. Execute a restricted query to retrieve information about the customer with the ID of 212.
6. Execute a restricted query to retrieve the customer whose first name is “Meenakshi.”
7. Try each of these restricted queries:
a. Retrieve all cities starting with San.
b. Retrieve all customers based in the U.S. with a low credit limit.
8. Display the customer details for Harrison Sutherland, and then click Orders to invoke the
Orders form module. r a ble
9. Click Image Off and notice that the image item is no longer displayed. Click Image s e and
fOn
t r a n
notice that the image item is displayed.
on -
10. Query only those orders that were submitted online. a n
11. Move to the fourth record (Product ID 2322) in the Item block a s
h dOrder
of ฺ 2355, and then
click Stock. The INVENTORY block is displayed inoam
)
separate u i e
window with the stock
l ฺ c t G
information for that item.
m ai den
12. Close the Stock Levels window. For@ thegcustomertu Harrison Sutherland, insert a new record
e l
in the ORDER block, as detailedbbelow. Notice
S
is that some items are already populated with
ฺ r u t h
afithe following:
default values. Then enter
(k to u se
f i
a nse V alue
Item
l K
e lice
h H
O nline U nchecked
13. Insert a new record in the ITEM block with the following values:
Item Value
Product ID 2289 (Enter the ID, or click the List
button and select KB 101/ES.)
Quantity 2
Practice 2 (continued)
14. Save the new records.
15. Update the order that you have just placed, and then save the change.
Note: You may receive a message indicating that there are no changes to save. This
message is generated by the Customers form, because both forms are saved at the same
time. Changes to the Orders form should be saved successfully, so you can acknowledge
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Forms Builder
Forms
Forms Compiler le
Services
r a b
sf e
Definitions
t r an
on -
s an
) ha deฺ
c o m Gui
Run files
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Forms Developer Executables
K n
el lictheefollowing
Forms Builder H includes two executables (components) that you can access as the
designer h
laof applications.
d u
Ab • Forms Builder: This is the application-building component of Oracle Forms Developer.
You can use Forms Builder to design and store the definitions of form, menu, and library
documents. While in the Forms Builder, you can invoke the other component, Forms
Compiler. You must run the Forms Builder component in a GUI environment in order to
use its graphical design facilities.
• Forms Compiler: After your form is built, use the Forms Compiler. This reads the
definition of your module and creates an executable run file.
Invoking Forms Builder Executables
In a GUI environment, you usually store commands to invoke Forms Builder components in
menus and icons for convenient access. You can also enter these commands on the command
line.
command line. Instead, they are invoked by entering a URL, directed to Forms Services, in a
browser.
The files used at run time must already have been compiled by the Forms Compiler component.
These files must reside on the middle-tier machine in a directory accessible to the Forms
Runtime Engine (in FORMS_PATH).
To test your applications, you can also access Forms Services directly from Forms Builder by
setting certain preferences, as described later in this lesson.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
PL/SQL Object
library library
a b le
er
a n sf
- t r
on
s an
Oracle Forms Developer
) ha deฺ
components
c o m Gui
Data ฺ
ailsources n t Database
m
g Stud e
Copyrightb©e
l @ is All rights reserved.
ฺ r u t h
2006, Oracle.
( k afi o use
Forms Developer Modulea fi Typess e t
K
el can en of many modules—that is, files. A module is a major
A Forms application
H l i cconsist
l
component
u ah of your application and is the basis for storage and ownership. A module owns the
bd that it contains.
Aobjects
A Forms Developer module can be of the following types:
• Form: As the main component of an application, the form module presents the objects and
data that users can see or interact with. Data items in a form are arranged into records.
• Menu: A menu module can consist of a hierarchy of menus, each with selectable items.
Forms Builder provides the default menu for every form. The default menu includes
commands for all basic database operations, such as insert, delete, query, and so on. If your
application has specific requirements that are not met by the default menu, then you can
create a custom menu module. You can use a menu module with multiple forms.
You can build an application from multiple form modules, menu modules, and library documents
as needed. A form module can be run independently, but menu modules, PL/SQL libraries, and
object libraries are functional only when attached to or included in a form module.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
( k a ou
Forms Builder: Key a i
f se t
Features
K
ela major en
Forms Builder
h H is
l i c component of Oracle Forms Developer. You can use Forms Builder to
quicklyla
develop form-based applications for presenting and manipulating data in a variety of
d u
Ab
ways.
Users of Forms Builder applications can:
• Insert, update, delete, and query data by using a variety of interface items
• Present data by using text, image, and custom controls, including JavaBeans and Pluggable
Java Components
• Control forms across several windows and database transactions
• Access comprehensive facilities by using integrated menus
• Send data directly to Oracle Reports
As the designer of Forms Builder applications, you can:
• Design forms that use a number of data sources, including Oracle databases
• Build applications quickly and easily by using powerful GUI development tools
• Design applications for Internet deployment
• Copy and move objects and their properties easily between applications
• Use design features such as wizards, the Layout Editor, Object Navigator, and PL/SQL
Editor
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Forms Builder Components: fi seProperty
t Palette
l K e n
All objects inHaemodule,icincluding the module itself, have properties that you can see and modify
h l
d u la
in the Property Palette. Features include:
Ab• Find field reuse
• Copy and properties from another object
and icons, similar to the Object Navigator
Toolbar
Tool
palette
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Forms Builder Components: fi seLayout t Editor
K en design facility for creating and arranging interface items and
el is algraphical
The Layout Editor
H i c
l
graphical
u ahobjects in your application. You can use the Tool palette and the toolbar available in
bdLayout Editor to design the style, color, size, and arrangement of visual objects in the
Athe
application. The layout can include graphical objects and images.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Forms Builder Components:fi sePL/SQL t Editor
l K
e enables n
e you to incorporate PL/SQL code objects into your form. Code
The PL/SQLH Editor
l i c
inh
objectsla Forms Developer include event triggers, subprograms (functions and procedures),
b d
menu
uitem commands, menu startup code, and packages. You enter and compile code in the
APL/SQL Editor. You will learn more about the PL/SQL Editor in later lessons when you use it to
code triggers in Forms Builder.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Navigating the Forms a fiBuilder
s e t Menu
Main
K
el main en contains options that enable you to create, modify, and manage
The Forms Builder
H l i cmenu
l
your form
u ahmodules.
bd Menu Features
ACommon
The following table describes some common features in GUI menus:
F eatu re D escrip tion
U nderline S hortcut key: [A lt] + letter
E llipsis (… ) A dditional input, usually by using a dialog box
M enu option has a subm enu
W indow s m enu List of open w indow s; select any w indow to m ake it active
H elp List of help facilities: O nline H elp, F orm s on O T N , A bout box
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Canvas 1 Canvas 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
Items ) ha deItems
ฺ
m i
i l ฺ co t Gu Block B
Block A
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Forms Module Components i
f se t
K
l upcthe
emake enmain “body” of an Oracle Forms Developer application. They can
Forms modules
H i
ofh
consistla
l
many types of objects, some of which are visible to the user at run time.
d u
b three major objects in a form are:
AThe
• Items: These are interface objects that present data values to the user or enable the user to
interact with the form, depending upon the item type. There are several types of items.
Items are logically grouped into blocks and visibly arranged on canvases.
• Blocks: A block is the intermediate building unit for forms. Each form consists of one or
more blocks. A block is the logical owner of items, and each item in a form belongs to a
block. Items in one block are logically related (for example, they may correspond to
columns in the same database table or may need to be part of the same navigation cycle).
Blocks, therefore, provide a mechanism for grouping related items into a functional unit for
storing, displaying, and manipulating records.
windows for each canvas so that several canvases can be viewed at once.
Note: Items in one block do not need to be physically grouped. They can span many canvases
(and windows).
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Navigation in a Block
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Canvas 1 Canvas 2
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Navigation in a Form a i
fModule e t
K
l you n s
eprincipally
When you runH aeform, i c navigate by way of items and blocks, not by canvases.
h l
d u la has a sequenced position within its block, and each block has a sequenced position in
Each item
Ab
the form.
When a user requests to move to the next item in a block, focus will be set on the next item in
sequence, wherever that may be. If the next item is on a different canvas, Oracle Forms
Developer displays that canvas automatically. Similarly, users can request to move to the next
block (or previous block). If the first item in this block resides on another canvas, then that
canvas is displayed automatically.
If you can already see the item that you want to move to, then you may click it with the mouse.
You can also program mechanisms into the application to enable navigation in other ways.
Data Blocks
A B C
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Table 3
4
1 Detail data block
5
X Y Z
a b le
er
X Y Z a nsf
- t r
on
s an 6
) ha deฺ
c o m Gui
Table
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Types of Blocks a fi se t
K n main types of blocks: data blocks and control blocks.
el therelicareetwo
In Forms Builder,
H
l ah
DatauBlocks
bd you build database applications with Forms Builder, many of the blocks will be data
AWhen
blocks. A data block is associated with a specific database table (or view), a stored procedure, a
FROM clause query, or transactional triggers.
If it is based on a table (or view), the data block can be based on only one base table, even
though the data block can be programmed to access data from more than one table and data
sources. By default, the association between a data block and the database enables the user to
automatically access and manipulate data in the database. However, to access data from other
tables (nonbase tables), you need to write triggers.
• Generate SQL at run time (implicit SQL) to insert, update, delete, and query rows in the
base table, based on the user’s actions.
At run time, you can use standard function keys, buttons, menu options, or standard toolbar
options to initiate query, insert, update, or delete operations on base tables, and the subsequent
commit of the transaction.
Control Blocks
A control block is not associated with a database, and its items do not relate to any columns
within any database table. Its items are called control items. For example, you can create many
buttons in your module to initiate certain actions, and you can logically group these buttons in a le
b
control block.
sf era
Master Versus Detail Blocks
- t r an
To support the relationship between data blocks and their underlying basen on you can define
tables,
s
one data block as the detail (child) of a master (parent) data block. This alinks primary key and
foreign key values across data blocks, and synchronizes the data
a
) hthat theseeฺdata blocks display.
m
o needed u i d
Forms Builder automatically generates the objects andlฺc code t G to support master-detail
a i n
relationships. As the designer, you need only request
g m it.tude
Note: If your application requires it, you e @alsoiscreate
lcan S independent data blocks in which there
b
u blocks. t h
is no relationship between the two
a f iฺrdatau s e
f i (k toBlocks
Single-Record Versus Multirecord
K
You can design aldata ablockntosshow
e one record at a time (single-record block) or several records
He block).
at once (multirecord
e
lic Usually, you create a single-record data block to show master block
data u l a h
and a multirecord data block to show detail block data. In either case, records in a data
b d
Ablock that are currently not visible on the screen are stored in a block buffer.
Form C
Block 2 Open Form
Block 2
Open Block 1
Block 3 Form
Form A Form B
a ble
er
Block 4 Multiple form modules
an sf
- t r
on
s an
) ha deฺ
Single Form
c o m Gui
Module
m ailฺ dent
@ g Stu
Copyrightb e l isAll rights reserved.
ฺ r u t h
© 2006, Oracle.
( k afi o use
a fi sApplications
Multi-Block and Multi-Form e t
K
el Builder n
eapplication
Typically, a H
h
Forms
l i c consists of more than one data block. With more than one
Data Blocks in the Same Form Module Data Blocks in Different Form Modules
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
The data blocks can be directly linked in The data blocks cannot be linked by the
master-detail relationships. standard interblock relations.
Navigation between data blocks is Navigation between data blocks of different
handled by default functionality. forms is programmed by the designer
(although mouse navigation to visible items
can be automatic).
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u l a
b d
A
Module
Database
Table
Blocks
Column
Trigger
Trigger Item
Frame Item le
Program
Program Item
Canvas
r a b
Units
units sf e
t r an
Trigger on -
Trigger s an
) ha deฺ
Window c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Form Module Hierarchy a fi se t
K
el licen
Technical Note
H
A form l h is made up of one or more blocks. A data block is based on a database object,
amodule
u
bd as a table or a view. A data block can contain both data items and control items. A frame
Asuch
can be created to arrange data block items. To be visible to the end user, each item in a block
must appear on a canvas, and each canvas must appear in a window. A form module can have
one or more canvases and windows.
Using triggers, you can add functionality to your form. Triggers can be written at different levels
in a form module. User-named program units enable you to write additional PL/SQL code
through procedures, functions, and packages.
Object Description
Block Logical section of a form; owned by the form module
Item Member of a data block (items are functionally grouped into records)
Canvas The surface where visual objects are arranged; owned by the form
module; can contain text and graphics⎯static information that the
user cannot interact with.
Window Produced to contain the views of canvases; owned by the form module
Frame A graphic object that appears on a canvas, is owned by that canvas,
and is used to arrange the items within a data block
a ble
er
User-named Named procedure, function, or package owned by the form module
an sf
program unit
- t r
Trigger on can be
PL/SQL block executed on an event; depending on scope,
n
owned by the form module, a data block, or ans a
item
Other objects a eฺ parameters,
) hincludeidalerts,
Mainly owned by the form module itself;
and record groups m
co t Gu
i l ฺ
g ma tuden
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
H
u l ah
d
Ab
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Customizing Your Forms fi Builder
s e t Session
K
el Forms n
eDeveloper
What Are Oracle
h H l i c Preferences?
You u
d lause preferences to customize some aspects of your Forms Builder session.
can
b Builder Preferences
AForms
There are four tabs in the Preferences dialog box.
To see a description of each preference, click Help in the Preferences dialog box or press the
Help key ([F1] for Windows).
In addition to session preferences, you can also set run-time settings that apply to running your
form from within the builder.
To modify preferences, perform the following steps:
1. Select Edit > Preferences.
2. Specify any options that you require.
3. Click OK to save changes or Cancel to cancel changes.
Saving Preferences
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Existing
preferences file
Modified
preferences
a b le
er
an sf
- t r
Motif: n on
s a
prefs.ora
Updated, merged a
hWindows:
) eฺ
m i d
preferences file
a
o Gu
ilฺc ent
cauprefs.ora
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Saving Preferencesaf i e t
K
l in the
eOK n s
ePreferences
When you click
h H l i c dialog box, Oracle Forms Developer updates your current
sessionla
with the changes.
d u
b you exit the builder (File > Exit), Oracle Forms Developer writes the changes to a
AWhen
preference file for future sessions. The name of the preference file varies on different platforms.
Oracle Forms Developer and Oracle Reports Developer share the same preference file. If the
preference file already exists, Oracle Forms Developer merges its changes with the existing file.
This does not affect preferences for Reports.
Each option in the preference file is prefixed by the tool name to which it belongs.
Example:
Forms.build_before_run = on
Forms.welcome_dialog = on
Oracle Forms Developer reads the preference file whenever you invoke Forms Builder. Oracle
Reports Developer reads the preference file whenever you invoke Report Builder.
Note: The preferences file is an editable text file. If possible, however, you should alter the
options in the Preferences dialog box.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Invoking Online Help a i
fFacilities
e t
l K
eDeveloper s
n Options
eHelp
Oracle FormsH l i c
l ah table describes the Help menu options in Forms Builder:
The following
u
d
Ab Help Menu Option Description
Online Help Comprehensive online Help window with three tabs. The
Contents tab provides access to a variety of manuals and
references. There are also Index and Search tabs.
The Help key ([F1] for Windows NT/95) displays context-
sensitive online Help at any place in the Builder.
Forms on OTN The latest product information on Oracle Technology
Network
About Form Builder This is a separate window that shows product components
and their version numbers. When you are connected to a
database server, it also displays similar information for
server-side product components.
You can also invoke context-sensitive online Help from Forms Builder by pressing the Help key
([F1] on Windows).
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
( k a ou
a i
f se tVariables
Oracle Developer Environment
K en
IntroductionHel i c
l
Oracle
u l ah Developer uses many environment variables. These have default values, all of
Forms
bd you can modify in your own environment for different applications.
Awhich
Setting Search Paths for Run Time
Forms uses some environment variables set on the middle-tier machine to search at run time for
files such as forms, menus, and libraries. This enables you to build applications that are portable
across platforms and directory structures by avoiding hard-coded paths in file references.
Forms searches the following paths in order until the required file is found:
• The current working directory
• Directories in FORMS_PATH
• Directories in ORACLE_PATH
Although you could set these variables at the machine level, such as in the Windows Registry, it
is preferable to set them in the Forms environment file. Settings in this file override system
settings for running a Forms application.
• NLS_DATE_FORMAT
• FORMS_USER_DATE_FORMAT
• FORMS_USER_DATETIME_FORMAT
• FORMS_OUTPUT_DATETIME_FORMAT
• FORMS_OUTPUT_DATETIME_FORMAT
• FORMS_ERROR_DATE_FORMAT
• a ble
FORMS_ERROR_DATETIME_FORMAT er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se tVariables (continued)
Oracle Developer Environment
K en
elFormslicDeveloper
Dates in Oracle
H
l
Datesuin
h Forms Developer applications can be fetched from the database, entered by the
aOracle
bduser, or defined in the application itself.
Aend
Date Format Masks
In a later lesson, you will learn how to specify a format mask for a date item in your form. In
addition to the format masks a developer might explicitly define, Forms Builder uses several of
its own internal masks. The values for these internal masks can be specified with environment
variables.
To eliminate potential errors caused by the year 2000 (Y2K), you can set environment variables
that Forms Builder uses to format date items:
• Database date format mask: Each database session within a Forms application has a
single database date format mask. A default value for this mask is established by the Oracle
server’s initialization parameter. You can override this value in each new database session
for a particular client by setting the client’s NLS_DATE_FORMAT environment variable.
the format exemplified by 30-06-97. The RRRR token enables years between 1950 and
2049 to be entered with the century omitted.
• Output date format masks: This mask converts dates displayed in output such as lists of
values: FORMS_OUTPUT_DATE_FORMAT or FORMS_OUTPUT_DATETIME_FORMAT
• Error date format masks: This mask converts dates displayed in error messages:
FORMS_ERROR_DATE_FORMAT or FORMS_ERROR_DATETIME_FORMAT
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
d u la 32-bit environment, use the Windows Registry to modify these paths, except for
In a Windows
b
ACLASSPATH, which is set in the System settings of the Control Panel. You can also override
these settings at run time in the file that controls the Forms run-time environment, which is the
default.env file unless a different file is specified.
Using the Forms environment file makes it easier to deploy the application on any platform. You
can specify which environment file to use in a special Forms configuration file, which is called
formsweb.cfg by default. In this configuration file, you can set system parameters, such as
the name of the environment control file. You can also set parameters to control which form to
run, the user ID, aspects of the Java client and the HTML file that contains the Java applet, and
many other settings.
( k a ou
Testing a Form withathe i
f RunseForm t Button
K
l command
emenu en or button enables you to run a form module in a Web browser
The Run Form H l i c
l ah Forms Builder. This makes it easy to test your application in a three-tier
from within
u
bd
Aenvironment, with all components appearing and behaving as they would for a user of the
application.
By default, the testing occurs on the development computer where Developer Suite is installed.
The default settings in the Forms Servlet configuration file are used, and no parameters are
passed on the URL.
Builder. You can also use the config parameter to specify a named configuration in the
Forms Web configuration file (formsweb.cfg by default).
Example for the same machine with OC4J running on the default port of 8889:
http://127.0.0.1:8889/forms/frmservlet?config=myapp
Note: You can enter the default setting in the Application Server URL field by clicking
Reset to Default.
3. Set the Web Browser Location (needed only if you want to run in a different browser than
the default for your machine).
Exiting the Session
r a ble
fe
The correct way to exit a Forms session is to exit the form (Action > Exit, or click Exit),sthen
n
t r
close the browser. If you close the browser without first exiting the form, your session
- a may hang.
You will notice this because you may not be able to recompile the same form,n onbut will receive
the error: FRM-30087: Unable to create form file.aIfsthis a happens, you can open
Task Manager and end the frmweb process manually. ) h ideฺ
l ฺ c om t Gu
m ai den
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
l K
eDeveloper enexecutables are the Forms Builder and the Forms Compiler
• The Forms
H l i c
l
• With
u ahForms Builder, which is an Oracle Forms Developer component, you can develop
d
Ab form-based applications for presenting and manipulating data in a variety of ways. Forms
Builder enables screen-based queries, inserts, updates, and deletes of data.
• Forms Builder provides powerful GUI and integration features.
• Applications consist of form modules, menu modules, and library documents.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary (continued) a i
f se t
K
el consist enof logical data blocks. A data block is the logical owner of items.
• Form modules
H l i c
l ah in one data block do not need to be physically grouped. Items in one data block can
Items
u
d
Ab span several canvases.
• Environment variables govern the behavior of:
- Running forms (set in the Forms environment file)
- Forms Builder (set on the development machine, such as in the Windows Registry for
Windows platforms)
• You can run a Forms application from within Forms Builder in order to test it in a browser.
You specify the URL to use in the Runtime tab of the Preferences dialog box.
Practice 3: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Practice 3: Overviewaf i e t
K
l become
eyou s
enfamiliar with Oracle Forms Developer by performing the following
In this practice,
H l i c
tasks: lah
duExamining the Object Navigator in Forms Builder
Ab•• Setting Forms Builder preferences
• Using the Layout Editor in Forms Builder to modify the appearance of a form
In addition, you set run-time preferences to use OC4J to test your application on your local
machine. You also set environment variables so that images display on iconic buttons in the
Layout Editor of Forms Builder.
Note: For solutions to this practice, see Practice 3 in Appendix A, “Practice Solutions.”
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A a. Invoke the Layout Editor.
b. Move the three summit shapes to the upper-right corner of the layout. Align the
objects along the bottom edge.
c. Select the summit shape in the middle and place it behind the other two shapes.
d. Draw a box with no fill around the summit shapes.
e. Add the text Summit Office Supply in the box. If necessary, enlarge the box.
f. Move the Manager_Id and Location_Id items to match the screenshot.
g. Move the First_Name item up to align it at the same level as the Last_Name item.
h. Resize the scroll bar to make it the same height as the three records in the Employees
block.
i. Save the form module.
name)
Port 8889 (for OC4J) (or the OC4J port
on your local machine)
Pointer to Forms Servlet forms/frmservlet
11. In Forms Builder, open and run the Customers form located in your local directory. (You
must have OC4J running first.)
Note: Run-time fonts may look different from the fonts used in Forms Builder because
Forms Builder uses operating system–specific fonts (but at run time, only Java fonts are ble
used). In addition, the appearance is different from the Layout Editor because the Oracle
s f era
(rather than the generic) look and feel is used by default.
- t r an
12. Click the Account Information tab. You should be able to see the image
n onof a flashlight on
the List button. Exit the run-time session and close the browser window.
s a
13. In Forms Builder, open the Layout Editor for the CV_Customer
) a
h deฺ by expanding the
canvas
Canvases node in the Object Navigator and double-clicking o m G i
theuCV_Customer canvas icon.
l ฺ c t
In the Layout Editor, click the Account Information
m ai dtab. e nWhat do you observe about the
List button? g Stu
14. From the Windows Start menu,b e l@Run,isenter
choose regedit, and click OK. Expand the
u t h
iฺr use > SOFTWARE > ORACLE. Click the ORACLE
registry nodes HKEY_LOCAL_MACHINE
k a f
f ( nodes
node, or one of theiHOME
t o beneath it; your instructor will tell you which node to
open. Ensure K a
l thatexists
you have
n e
s opened the correct node by verifying that the key
H
FORMS_PATHe e
lic that node.
in
h
lathe path for Forms Builder to locate icons:
15.uSet
d
Ab a)b) For Double-click the UI_ICON key to open it for editing.
the value data, append the path to the .gif file that you will use for the button
icon, which is the \icons subdirectory of your lab directory. Separate this path
from the remainder of the string with a semicolon (for example:
;e:\labs\lab\icons), and then click OK.
16. Similarly, set the value for Forms Builder to use for the icon extension, and then close the
registry editor.
17. Close and reopen Forms Builder. Open the Customers form and verify that the flashlight
icon now displays in the Layout Editor.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Introduction a i
f se t
l K en
Overview He l i c
l h Developer applications usually consist of one or more form modules. Each form
aForms
u
Oracle
bd comprises data blocks that are built using table specifications from the database. This
Amodule
lesson shows you how to create a basic form module and its data blocks. You also learn to
deploy a form module.
Create data blocks and items; lay out the items on a canvas.
Apply standards.
a b le
Set object properties. er
an sf
- t r
on
Add code.
s an
) ha deฺ
c o m Gui
ailฺ dent
Test form module.
m
g Stu
e l @ is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Form a fiModule
s e t
K enprocess for creating a new form module and data blocks within it.
el thelibasic
This lesson H
covers c
h a New Form Module
Howutol aCreate
bd following actions, along with the tools that are typically used to perform them, are part of
AThe
creating a form module (although all actions may not be performed for every module):
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Name
property
a b le
er
an sf
- t r
on
s an
) ha deฺ
Coordinate
c o m Gui
System property
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Form Module a fiProperties
s e t
K
el consists enof several objects. Objects within a form, and the form module
Each form module
H l i c
ah properties that define their behavior. You can see the properties of an object and
itself, lhave
u
bd values in the Property Palette of the object.
Atheir
To open the Property Palette of an object, perform one of the following steps:
• Double-click the object’s icon in the Object Navigator.
• Double-click the object in the Layout Editor
• Select the object in the Object Navigator and select Tools > Property Palette.
• Right-click the object in the Object Navigator or in the Layout Editor and select
Property Palette from the context menu.
To obtain online Help for any of the properties, click the property and use the Help key ([F1]),
to display a description of that property.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Data a i
fBlock e t
l K
econsists s
enone or more data blocks and control blocks. Now that you know
A form module
H l i c of
h a new form module, you need to create new data blocks within it.
how tola
create
u
bd creation involves creating the data block and then laying out its contents for visual
ABlock
presentation. You can create a data block manually or by using the Forms Builder wizards. In
this lesson, you learn how to create a new data block based on a database table, using the Data
Block Wizard and the Layout Wizard.
Note: Recall that a data block can be based on a table or view, a stored procedure, a FROM
clause query, or a transactional trigger. In this course, you use database tables as the source.
Block Wizard.
Enter data
Source.
Launch Layout
Reentrant mode
a b le
er
Wizard.
an sf
- t r
on
n block
New data
s a
Lay out data a
) h ideฺ
block contents. m
co t Gu
i l ฺ
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Creating a New Data a i e t
fBlocks(continued)
K
el licen
Data BlockH Wizard
The u l
DataahBlock Wizard enables you to create (or modify) data blocks quickly and easily for
bdin your application. The wizard can automatically generate code to enforce integrity
Ause
constraints in the database.
Layout Wizard
Although the Data Block Wizard enables you to create a new data block easily with its
associated data sources, it does not deal with the visual presentation of objects included in the
data block. After you create the data block, you need to lay out its contents for user
interaction. To accomplish this task quickly and easily, use the Layout Wizard.
Note: The wizards are not the only way to perform a task such as building a data block, but
they are usually the simplest. You can build a block manually instead of using the wizards.
Available only
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
in reentrant mode
If you click Next or Back before entering all necessary information for a particular wizard
page, then the wizard prevents you from navigating to another page. Similarly, if you have not
entered all necessary information into the wizard when you click Apply or Finish, the wizard
automatically takes you to the page where you can finish entering the required information.
In reentrant mode, which enables you to modify existing blocks or layouts, the wizards have a
tabbed interface that enables you to quickly navigate to the section you want to modify. You
learn more about modifying data blocks and layouts in the lesson titled “Creating a Master-
Detail Form.”
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Data a i
fBlock with
e t the Data Block Wizard
K
el Wizard s
ento create a new data block with its associated data sources. The
Use the DataHBlock l i c
l ah Wizard consists of several pages. To create a new data block, you must interact
Data Block
u
bd each page.
Awith
Welcome Page
Click Next to continue.
Type Page
Choose between one of two data source types:
• Table or View
• Stored Procedure
Select the Table or View (default) option.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Data a i
fBlock with
e t the Data Block Wizard (continued)
l K en s
Table PageHe l i c
l ah the table or view name for the data source name, or click Browse and select a
1. Enter
u
d
Ab name from a dialog box.
2. Click Refresh to display a list of columns in the selected table or view. If you are not
connected to the database, the Connect box is displayed.
3. Select the columns you want to include in the data block. (To select more than one
column, press and hold [Ctrl] and then select the columns.)
4. Click the double-right arrow or the double-left arrow to include or exclude all columns,
or click the right arrow or the left arrow to include or exclude selected columns only.
5. Select the “Enforce data integrity” check box if you want the wizard to enforce the
database integrity constraints.
Note: If there is at least one other existing block in the current module, the next page that
displays is the Master-Detail page, where you can associate the new data block with other
master data blocks. This page is discussed in the lesson titled “Creating a Master-Detail
Form.”
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Data a i
fBlock with
e t the Data Block Wizard (continued)
l K en s
Finish PageHe l i c
u
Select l ah“Create the data block, then call the Layout Wizard” option. Select Finish to create
the
bdnew data block and immediately invoke the Layout Wizard.
Athe
Note: You have the option of exiting the Data Block Wizard at this stage, without
immediately invoking the Layout Wizard. If you do so, you can either lay out the data block
manually or invoke the Layout Wizard at a later time to lay out the items of a data block. To
invoke the Layout Wizard at a later time, select the data block in the Object Navigator, and
choose Tools > Layout Wizard.
• Launch automatically
from the Data Block Wizard.
or
• In Forms Builder, do one
of the following:
– Select Tools > Layout Wizard.
– Right-click and select Layout
Wizard.
a ble
er
– Use the Layout Wizard button
on the toolbar. an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Launching the Layouta fi Wizard
s e t
K
el lWizard en to create a new layout, perform one of the following steps:
To launch the
H Layout i c
l ah automatically from Data Block wizard
• Launch
u
d
Ab• In the Forms Builder, do one of the following:
- Select Tools > Layout Wizard from the Forms Builder default menu system.
- Right-click and select the Data Block Wizard option.
- Click the Layout Wizard on the toolbar.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Laying Out a New Dataa fi Blocks e t the Layout Wizard
with
l K n
Use the Layout
H eWizardl i toelay out the data block items for visual presentation quickly and
c
easily.la h Layout Wizard consists of several pages. You must interact with each page.
The
u
bd Page
ACanvas
1. Select New Canvas from the Canvas pop-up list to get a new canvas on which to display
the data block items.
2. Select Content as the canvas type in the Type pop-up list.
Data Block Page
1. Select the items that you want to display in the data block frame. (To select more than
one column, press and hold [Ctrl] and then select the columns.)
2. Click the double-right arrow or double-left arrow to include or exclude all items, or click
the right arrow or the left arrow to include or exclude selected items only. You can also
drag selected items from one list to another.
Note: To lay out the items in a particular sequence, drag the items into that sequence.
3. You can use the Item Type pop-up list to select a type for each item. The default type is
Text for each item.
Note: An item type can also be changed later to something else, such as a pop-up list or
a radio group.
Items Page
Specify prompt text and display width and height for each display item.
Oracle Forms Developer 10g: Build Internet Applications 4-16
IT Bangla Ltd
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Laying Out a New Data a fi Blocks e t the Layout Wizard (continued)
with
l K en
Style Page He l i c
l h
aalayout style for your frame. Your options are:
u
Select
d
Ab• Form (usually used to create single-record data blocks)
• Tabular (usually used to create multirecord data blocks)
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Laying Out a New Data a fi Blocks e t the Layout Wizard (continued)
with
l K en
Rows Page He l i c
l ah a title in the Frame Title field.
1. Enter
u
d
Ab2. Enter the number of records that you want to display at run time in the Records
Displayed field.
3. Enter the physical distance (in the coordinate system unit of the form) between records if
you are displaying more than one record at a time.
4. You can select the Display Scrollbar check box to display a scroll bar next to the frame
(common for multirecord data blocks).
Finish Page
Click Finish to create a new frame and lay out the selected items for the new data block. The
Layout Wizard steps are complete.
Note: After you complete the Layout Wizard steps, you can view the layout in the Layout
Editor, where you can customize or modify the layout if necessary.
Template Forms
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Template Forms afi e t
K
eal newlform s
enbased on standard template forms, so that you can provide other
You can create
H i c
l ah with a default starting point. Templates typically include generic objects, such
team members
u
d
Aasb graphics, toolbars, and program units. You can define standard window layouts, standard
toolbars, and other common objects that you want to include in new forms.
Creating a Form Based on a Template
To create a form based on a template, perform one of the following:
• Start Forms Builder. In the Welcome to the Forms Builder dialog box, select the “Build
a form based on a template” option, and then click OK.
• Select File > New > Form Using Template from the menu.
1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
4
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Compiling a Form Module fi se t
K
l a form,
erun enyou must compile an executable (.fmx) file from the design
Before you canH l i c
h that you created in the Forms Builder. Compiling a form (or menu) module
(.fmb)
u l afile
bd the needed executable file.
Acreates
Action Type of Compilation
1. With module open in Form Builder, select Program > Explicit
Compile Module (or click the Compile Module icon).
2. Launch the Form Compiler component from the Explicit
command line (frmcmp.exe).
3. Launch the Form Compiler component from the Explicit
Windows Start menu.
4. Set Build Before Running preference. Implicit
Note: Compiling and saving are two independent tasks. Performing one does not
automatically accomplish the other. Both tasks must occur separately.
PL/SQL
.pll a ble
.plx .pld er
Library
an sf
- t r
on
Object s an
Library .olb
) ha .oltd eฺ
m i
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Module Types and a i
f sFormats
Storage e t
K en menu modules, and library documents in the Forms Builder,
el formlimodules,
When you create
H c
h in source files (.fmb, .mmb, and .pll) that have a binary format and are
l
they are
u astored
bd across platforms. The executable application files (.fmx, .mmx, and .plx) are also
Aportable
in a binary format; however, they are not portable across platforms.
Module/ Portable
Document Extension Storage Format
Form .fmb Form module binary Yes
.fmx Form module executable; executable No
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1 2
.fmb
.fmx
3
1. Move module files to
middle tier.
r a ble
2. Generate module on nsf
e
- t r a
middle tier. on
n
a using
3. Run in browser
a s
Forms h deฺ on
)Services
o m u i
lฺ c G
aimiddle
m tude nttier.
g
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Deploying a Form Module i
f se t
K n on your client machine, for production applications you usually
el testlica eform
Although you
H may
deployla h module to a middle-tier machine. This machine may be running on a different
the
u
bd if so, you need to recompile the module after you transfer it to the middle tier.
Aplatform;
You can use an FTP utility to move the .fmb and other needed files to the middle-tier
machine, into a directory specified in FORMS_PATH. If the platform is the same as your
development platform, you can move the .fmx and other executable files there as well. If it is
a different platform, you can invoke the Forms Compiler on the middle tier to recompile the
module files.
After the executables have been placed on the middle tier, you can invoke the application in a
browser, using a URL that points to the Forms Servlet on the middle-tier Web server.
a ble
• Convert a binary file to a text file. er
an sf
• Create an ASCII file for a form module. - t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Producing Text Files a i Documentation
fand e t
K
el produced s
en by saving and generating modules are in binary format. To
The files normally
H l i c
l
convert
u aahbinary file to text, perform the following:
d
Ab1. Select File > Convert.
This opens the Convert dialog box.
2. Select the type of module (Form, Menu, PL/SQL Libraries, Object Libraries), the file to
convert, and the direction (Binary-to-Text).
3. Select Convert. This produces a text file for the module with the name <module>
.fmt.
To produce documentation for your module, perform the following:
1. Select the module to be documented in the Object Navigator.
2. Select File > Administration > Object List Report from the menu. This produces an
ASCII file with the name <module>.txt.
You can also produce documentation in other ways not covered in this course:
• Use Forms API to produce custom documentation of the module.
• Convert the module to an .xml file with a separate utility included with Oracle
Developer Suite.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k afi o use
Summary a fi se t
K
el should n learned about:
ehave
In this lesson,
H you l i c
l ah a new form module by using the following methods:
• Building
u
d
Ab -- Manually
Forms Builder wizards
- Template form
• Using the Data Block Wizard to create a new data block with its associated data sources
quickly and easily
• Using the Layout Wizard to quickly lay out the new data block contents for user
interaction
• Saving the form module to preserve its definition; compiling it to get an executable file;
running the form module to test it
• Using several module types and storage formats that are available for form modules,
menu modules, PL/SQL Library documents, and Object Library modules, including a
text format that can be used for documentation
Practice 4: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 4: Overview a fi se t
K
l create
eyou enone new form module. You create a single-block form that displays
In this practice,
h H l i c
l
a single
u arecord.
d
Ab• Create a new form module called CUSTOMERS. Create a new data block in this form
by using the Forms Builder wizards, and base it on the CUSTOMERS table. Using the
Layout Editor, reposition the items in this block to match the screenshot provided.
• Save and run the new form module on the Web.
Note: For solutions to this practice, see Practice 4, in Appendix A, “Practice Solutions.”
Practice 4
1. Create a new form module.
Create a new single block by using the Data Block Wizard.
Base it on the CUSTOMERS table and include all columns.
Display the CUSTOMERS block on a new content canvas called CV_CUSTOMER and
display one record at a time. Set the frame title to Customers. Set prompts and widths as
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
2. Save the new module to a file called
g Stuwhere XX is the group number that your
@CUSTGXX,
be l is
instructor has assigned to you.
ฺ r u t h
3. Run your form module k fi execute
aand u sea query.
Navigate through
(
fithe fields. o the run-time session and return to Forms Builder.
tExit
K a s e
4. Change the
H c en name in the Object Navigator to CUSTOMERS.
el formlimodule
u l ah
A bd
Practice 4 (continued)
5. In the Layout Editor, reposition the items and edit item prompts so that the canvas
resembles the following:
Hint: First, resize the canvas and viewport. Do not attempt to resize the frame, or the
items will revert to their original positions.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
a ilฺ ent
6. Save and compile the form module. Click m
g RunSForm t u d to run the form. Execute a query.
l
7. Exit the run-time session and close @
e the browser
i s window.
u b t h
No formal solution
k a fiฺr use
a fi ( se to
e l K cen
hH li
l a
A bdu
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Detail ↑
Detail Detail Detail
Master ↓
a ble
er
an sf
Detail - t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating Data Blocks a i Relationships
fwith e t
K
l contain
ecan s
enone or more data blocks. Each data block can stand alone or be
A form module
H l i c
ahanother data block.
relatedlto
u
bd
AMaster-Detail Relationship
A master-detail relationship is an association between two data blocks that reflect a primary
key–foreign key relationship between the database tables on which the two data blocks are
based. The master data block is based on the table with the primary key, and the detail data block
is based on the table with the foreign key. A master-detail relationship equates to the one-to-
many relationship in the entity relationship diagram.
A Detail Block Can Be a Master
You can create block relationships in which the detail of one master-detail link is the master for
another link.
a ble
er
an sf
Items - t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating Data Blocks a i Relationships
fwith e t (continued)
l K
e Can lHave n s
e More Details
A Master Block
H i c
h more than one detail block for a master block.
You u l
can acreate
bd The following are examples of the master-detail structure:
ANote:
• Master-detail: Order-items
• Master-detail-detail: Customer-order-items
• Master-2*detail: Customer-order and customer-account reps
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Master-Detaila fi Form s e t
Module with the Data Block Wizard
l K n
e form module either by creating a relation between a master and
You can buildH aemaster-detail
i c
l
l ah explicitly, or implicitly by using the Data Block Wizard.
detail block
u
d Create the master block as described in the Creating a New Data Block section in the
Ab1. lesson titled “Creating a Basic Form Module.”
2. Invoke the Data Block Wizard in the Object Navigator.
3. Follow the same steps as before to create a new data block in the Data Block Wizard until
you come to the Master-Detail page. On this page, select the “Auto-join data blocks” check
box and click Create Relationship.
Note: If the “Auto-join data blocks” check box is not selected, the Data Block dialog box is
displayed with a list of all data blocks in the form without any foreign key constraint
names.
must use the Detail Item and Master Item pop-up lists to create a join condition manually.
5. Click Next, and then complete the Data Block Wizard steps. Perform the Layout Wizard
steps as described earlier in the lesson titled “Creating a Basic Form Module” to finish
creating and laying out the detail data block.
Note: The master data block must exist in the form module before you create the detail
block.
You can also create a relation by invoking the Data Block Wizard in reentrant mode.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Relation Object
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Relation a fi se t
Manually
K
ea lrelation en implicitly with the Data Block Wizard, or explicitly in the Object
You can create
H l i ceither
l ah
Navigator.
u
bd Relations
AExplicit
If a relation is not established when default blocks are created, you can create your own. To
explicitly create a relation, perform the following steps:
1. Select the Relations node under the master block entry in the Object Navigator.
2. Click the Create icon. The New Relation window is displayed.
3. Specify the name of the detail block.
4. Choose your master delete property.
5. Choose your coordination property.
6. Specify the join condition.
7. Click OK.
The new relation, new triggers, and new program units are highlighted in the Object Navigator.
Like implicitly created relations, the relation is given the default name of
MasterDataBlock_DetailDataBlock—for example, CUSTOMERS_ORDERS. The same PL/SQL
program units and triggers are created automatically when you explicitly create a relation as
when the relation is created implicitly.
Join Condition
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Join Condition a fi se t
l K
econdition n
eto:
• Use a join
H l i c
l-ahCreate links between blocks using SQL
u
d - Alter links between blocks using SQL
Ab• Define a join condition using:
- Usual SQL equijoin condition syntax (necessary because Forms copies the value from
the master block to the related item in the detail block)
- Block names instead of the base table names (do not precede with colon)
- Item names that exist in the form module instead of base table column names
Deletion Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Deletion Properties af i e t
K
el licen s
Master Deletions
H
l ahthe Delete Record Behavior property, you can prevent, propagate, or isolate deletion
By setting
u
d
Aofba record in a master block when corresponding records exist in the detail block. For example,
you can delete all corresponding line items when an order is deleted.
Property Use
Non Isolated Prevents the deletion of the master record when detail records exist;
the master record is deleted only if no detail records exist
Cascading Deletes the detail records when a master record is deleted
Isolated Deletes only the master record
Note: Although deleting with the cascading property may remove many detail records, the
commit message shows only the number of records deleted from the master block.
Modifying a Relation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Modifying a Relation a fi se t
K
elrelation n
eproperties
You can alterHthe
h l i c to affect the way deletes and block coordination are
d u la
handled.
b Happens When You Modify a Relation?
AWhat
• If you change the Delete Record Behavior property from the default of Non Isolated to
Cascading, the On-Check-Delete-Master trigger is replaced with the Pre-Delete trigger.
• If you change the Delete Record Behavior property from the default of Non Isolated to
Isolated, the On-Check-Delete-Master trigger is removed.
Coordination Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
a
Modifying the Structure i
f of sa eData t Block
K en you may want to customize or modify it by performing one of the
eal dataliblock,
After you create
H c
l ah
following:
u
d
Ab• Reenter the Data Block Wizard and use it to make the changes.
• Make manual changes, such as adding or deleting items, in Object Navigator.
• Change the property values of the block by using the Property Palette.
Invoking the Data Block Wizard in Reentrant Mode
A very powerful feature of the Data Block Wizard is its ability to operate in reentrant mode. Use
reentrant mode to modify the data block, even if the block was not originally created with the
Data Block Wizard.
To invoke the Data Block Wizard in reentrant mode, perform the following steps:
1. Select the frame or a component of the block in either the Object Navigator or the Layout
Editor.
2. Invoke the Data Block Wizard by performing one of the following steps:
- Select Tools > Data Block Wizard from the menu.
- Right-click and select Data Block Wizard from the pop-up menu.
- Click Data Block Wizard.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Practice 5: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 5: Overviewafi e t
K s
en a new form module that displays the master-detail information.
l willccreate
eyou
In this practice,
H i
l
l
• Create
u ah a master-detail form module called ORDERS. Create a master block based on the
d
Ab ORDERS table and a detail block based on the ITEMS table. Create a third data block that
is not related to any other block in the form module. Base this block on the
INVENTORIES table, and manually create a relation with the block based on the item
table. Use the Forms Builder wizards to create all three data blocks.
• Invoke the Layout Wizard in reentrant mode, and change the layout of the ITEMS and
INVENTORIES data blocks.
• Save and run the new form module on the Web.
Note: For solutions to this practice, see Practice 5 in Appendix A, “Practice Solutions.”
Practice 5
1. Create a new form module.
Create a new block by using the Data Block Wizard.
Base it on the ORDERS table and include all columns except ORDER_TOTAL and
PROMOTION_ID.
Display the ORDERS block on a new content canvas called CV_ORDER and show just one
record at a time. Use a form style layout. Set the frame title to Orders.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Introduction a i
f se t
K en
Overview Hel i c
l
In this
u l ah you learn how to customize existing data blocks and modify frames. You also
lesson,
bd how to include blocks that are not associated with the database.
Alearn
1
• Reentrant Wizard
– Data Block Wizard
– Layout Wizard
• Layout Editor
• Property Palette
a b le
er
sf
an
2 3 n - t r
a no
h a s ฺ
o m )
u ide
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Managing Object Properties i
f se t
K en properties of Forms Builder objects:
l to cmodify
eways
There are three
H i
l
l ah Wizards: You can modify data block and layout properties through the
• Reentrant
u
d
Ab• reentrant wizards, as explained in the previous lesson.
Layout Editor: If the object appears on a canvas, you can modify properties by using the
graphical Layout Editor.
• Property Palette: You can set individual properties for each Forms Builder object in its
Property Palette.
The wizards, the Layout Editor, and the Property Palette all depict object properties. Changes
made in one tool are reflected in the others. In the example in the slide, the prompt for
ORDER_ID is shown identically in:
1. Property Palette
2. Reentrant Layout Wizard
3. Layout Editor
You can use the Property Palette to control the behavior and appearance of any Forms Builder
object with a greater degree of granularity. In the Property Palette, you can fine-tune objects that
you have initially created in the wizards or the Layout Editor.
Find field
Toolbar
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Expand/ Search
collapse backward
Search
forward
Property Property
name value
Help:
a ble
Press [F1]. er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Property Palette: Featuresfi se t
K en of the Property Palette:
el the features
The following
H are
l i c
u l ah
d
AbFeature
Property list
Description
Displays a two-column list of names and values of
properties that are valid for a particular object. Properties
are grouped under functional headings or nodes. You can
expand or collapse a node by using the plus and minus
icons beside the node name.
Find field Enables you to quickly locate a particular property. The
Search Forward and Search Backward buttons enhance
your search.
Toolbar Consists of a series of buttons that provide quick access to
commands
Help Enables you to obtain description, usage, and other
information about any property by pressing [F1] with the
property selected
Property Controls
Text field
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
More button
LOV window
a b le
er
Pop-up list
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Using the Property Palette
K
elhas variousentypes of properties. Properties are manipulated differently,
Each form object
H l i c
l ahon the property type. The following is a summary of the controls that are used in the
depending
u
bd Palette:
AProperty
Property
Control Description
Text field A Text field is displayed when the current property can be set
by entering a text value. For longer text values, an iconic button
also appears, enabling you to open a text editor.
Pop-up list This appears where a fixed set of values, such as Yes or No, is
allowed for the property. Click the down arrow to open the list,
and then select a value.
LOV window LOVs occur where a potentially large list of possible values is
available. Click the iconic button in the property value column
to invoke an LOV.
More button Use this when more complex settings are needed. Click the
More button to open the extra dialog box.
Property Controls
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Changed
Default
Overridden
Inherited
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Property Palette Icons a fi se t
K
ela Property enPalette has an icon to its left. The following is a summary of these
Each propertyH in
l i c
l
icons and
u ahtheir description:
d
Ab Icon Description
Circle Specifies that the property value is the default value
Square Specifies that the property value has been changed from the
default
Arrow Specifies that the property value is inherited
Arrow Specifies that the property value was inherited but has been
with a cross overridden
Note: After you activate the Property Palette, its window remains open until you close it. The
window automatically displays the properties of each object you visit in the Layout Editor or the
Object Navigator. This is because, by default, the list of properties in the Property Palette is
synchronized whenever you select an object.
You can turn the synchronization on or off for a specific palette by clicking Pin/Unpin in the
Property Palette toolbar.
Visual Attributes
A Visual Attribute
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
is a named set of
properties defining:
• Font
• Color
• Pattern
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Visual Attributes afi e t
K s
encolor, and pattern properties that you set for form and menu
elare thelicfont,
Visual attributes
H
objects.lah
du
AAbVisual Attribute is another object that you can create in the Object Navigator with properties
such as font, color, and pattern combinations. Set the Visual Attribute Type property of the
Visual Attribute to Title if you plan to apply it to objects such as frame titles, or to Prompt if it is
used for prompts. Otherwise, set Visual Attribute Type to Common, which is the default.
Every interface object in a Forms application has a property called Visual Attribute Group,
which determines how the individual Visual Attribute settings of an object are derived. The
Visual Attribute Group property can be set to Default, NULL, or the name of a Visual Attribute
object. Blocks have a Current Record Visual Attribute Group property that defines the Visual
Attribute to be used for the current record in the block.
Partial Visual Attributes
You can define a Visual Attribute by setting only the properties that you want to be inherited by
the objects that use them. This means that you can apply a Visual Attribute that changes the font
color without having to set the font name.
a ble
1 2 er
an sf
- t r
on
s an
) ha deฺ
c o m Gui 3
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Using Visual Attributes fi se t
l K
eAttribute, n the following steps:
eperform
To use a Visual
H l i c
l ah the Visual Attribute:
1. Create
u
d
Ab -- Click Select the Visual Attributes node in the Object Navigator.
Create.
- Invoke the Property Palette for the Visual Attribute and set the desired font, color,
and pattern properties.
2. Set the object properties to use the new Visual Attribute:
- For items and canvases, set the Visual Attribute Group property.
- For blocks, set the Current Record Visual Attribute Group property.
3. Run the form to see the changes.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Font, Pattern, and Color fi Pickers
s e t
K en
elVisuallicAttributes,
When you create
H you can use the Font, Pattern, and Color pickers to select the
h
la and color.
font, pattern,
d u
b changing a font from the Property Palette, you can click the Font group itself to invoke the
AWhen
Font Picker. This enables you to select all font properties from one window; otherwise, you can
select each font property and invoke individual windows or pop-up lists that are specific to the
property.
Navigation Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
ORDERS
Order
Item
a b le
Same er
record
an sf
- t r
Next on
record s an
) ha deฺ
Next o m
navigation u i data block
c G
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Controlling the Behavior fi ofsDatae t Blocks: Setting Navigation Properties
K
el Normally, enwhen you navigate beyond the last item in a record, Forms returns
Navigation Style:
H l i c
ahbeginning of the same record. With this property, you can change this behavior to
you to lthe
u
bd to the next record or data block instead. The valid settings are Same Record (default),
Anavigate
Change Record, or Change Data Block.
Note: If you want the cursor to move to the next record when you reach the end of the current
record, then set the Navigation Style property for the block to Change Record.
Previous/Next Navigation Data Block
Normally, when you perform an operation to move to the previous or next data block at run time,
Forms moves control to the previous or next adjacent data block in sequence. These properties
enable you to name the previous or next data block.
Records Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Item
Current record
a b le
er
Number
an sf
- t r
of records on
s an
displayed
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi ofsData
Controlling the Behavior e t Blocks: Setting Record Properties
K en Attribute Group: This is the Visual Attribute that is used to
el liVisual
• Current H Record c
u l ah the current record in the data block.
highlight
d
Ab• Query Array Size: This specifies the maximum number of records that Forms should fetch
from the database at one time. A lower value in this property value means faster response
time; however, a larger value means fewer calls to the database for records, thereby
resulting in reduced overall processing time. When set to 0, this property defaults to the
Number of Records Displayed.
• Number of Records Buffered: This is the minimum amount of buffer space retained for
holding queried records in the data block. The minimum setting allowed is the value of the
Number of Records Displayed property plus 3. Forms buffers any additional records to a
temporary disk file. A higher value improves processing speed, but uses more memory.
Records Properties
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Controlling the Behaviora fi ofsDatae t Blocks: Setting Record Properties (continued)
K
elRecords n
eDisplayed:
• Number
h H of
l i c This property specifies the maximum number of records
d u la the data block can display on the canvas at one time and how many records you can
that
Ab for the
see at once. If you change this value, make sure there is enough room on the canvas layout
number of records, or the objects may overlap.
• Query All Records: This property specifies whether all the records matching the query
criteria should be fetched when a query is executed. (This property is necessary to support
the Calculated Field feature.)
• Record Orientation: This property determines the orientation of records in the data
block—horizontal or vertical. When you set this property, Forms Builder adjusts the
display position of items in the data block accordingly.
• Single Record: This property specifies that the control block should always contain one
record. Set this property to Yes for a control block that contains a summary calculated
item. You cannot set this property to Yes for a data block.
Database Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Controlling the Behavior a i
f ofsData e t Blocks: Setting Database Properties
K
l ofcthe
egroup enProperty Palette, you can set numerous properties to control
In the DatabaseH i
l
l ahwith the database server. Some of these properties are:
interaction
u
d
Ab• Database Data Block: Set to Yes if the data block is based on a database object, and No if
it is a control block
• Enforce Primary Key: Controls whether Forms checks for uniqueness before inserting or
updating records in the base table, in order to avoid committing duplicate rows in the
database. A value of Yes means that Forms checks that inserted or updated records are
unique before an attempt is made to commit possible duplicate rows.
• Query Allowed/Insert Allowed/Update Allowed/Delete Allowed: Control whether the
associated operations can be performed on the data block records
• Query Data Source Columns: Specifies in a dialog box, the name and data type of the
columns associated with the query data source. This property is used only if the type of the
query data source is Table, the FROM clause query, or Procedure.
• Query Data Source Arguments: Specifies in a dialog box, the names, data types, and
values of the arguments that are to be passed to the procedure for querying data. This
property is valid only when the Query Data Source Type property is set to Procedure.
• WHERE Clause: Specifies a SQL condition that is attached to every default SELECT
statement associated with the data block through implicit SQL; use to define general
restrictions on the rows that this data block may fetch. This clause is automatically
appended (ANDed) with any conditions supplied by the operator in Enter Query mode. r a ble
ORDER BY Clause: Defines a default order for records displayed from a query. n s
The
fe
tra
•
operator can alter this order by using the Query Where dialog box at runn -
time.
• Optimizer Hint: Specifies a hint string that Forms passes to the Optimizer a no when
constructing implicit SQL on the data block. The Optimizer h a s improve
can ฺ the performance
of database transactions. )
m Guid e
c o
• Locking Mode/Key Mode: Controls how Forms
a ilฺ handles
e n trecords and transactions when
the data block is primarily associated with m tuand Oracle
g non-Oracle data sources. The default settings are
usually appropriate for data blocks e l @
connected
i s S
with database.
• Update Changed Columns
b
u When
ฺrOnly: h
t this property is set to Yes, only those items
a f i s e
u to their corresponding database columns. If the operator
updated by the operator
f i (k are written
t o
commonly updates
l K a or ninserts
s e records with only one or two columns, this can save network
traffic. H
l e
Byedefault,icthis property value is set to No, so that all columns are included in the
h
default
la UPDATE statement.
du
Ab
Database Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Block display
SELECT ....
WHERE Clause a b le
er
[ORDER BY Clause] an sf
- t r
on
s an
) ha deฺ
c o m Gui
Work fileilฺ
m a dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi ofsData
Controlling the Behavior e t Blocks: Setting Database Properties (continued)
K en When this property is set to Yes, items in the data block can be
el liSecurity:
• Enforce H Column c
u l ah only if the current user has privileges to update the corresponding database
updated
d
Ab• columns.
Maximum Query Time: Provides the option to abort a query when the elapsed time of the
query exceeds the value of this property; useful when the Query All Records property is set
to Yes
• Maximum Records Fetched: Provides the option to abort a query when the number of
records fetched exceeds the value of this property; useful when the Query All Records
property is set to Yes
Record
Scroll
bar
height
a b le
er
sf an
n - t r
Scroll barowidth
a n
a s
m ) h ideฺ
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Controlling the Behavior i
f ofsData e t Blocks: Setting Scroll Bar Properties
K
l ofcthe
egroup enProperty Palette, you can set numerous properties to the appearance
In the Scrollbar
H i
l
l ah of the data block’s scroll bar. Some of these properties are:
and function
u
d Show Scroll Bar: Specifies whether Forms Builder should create a scroll bar for the data
Ab• block. To delete an existing scroll bar, set this property to No.
• Scroll Bar Canvas: Specifies the canvas on which the data block scroll bar is displayed.
The specified canvas must exist in the form.
• Scroll Bar Orientation: Specifies whether the scroll bar should be displayed horizontally
or vertically
• Scroll Bar X/Y Position: Specifies the x and y coordinates (measured in the coordination
system units of the form) where the scroll bar displays on the canvas. The default value for
both coordinates is 0.
• Scroll Bar Width/Height: Specifies the width and height of the scroll bar
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Controlling Frame Properties
K
el youlimakeenin the Layout Wizard when creating a data block are recorded as
The selections
H that c
l ahof the resulting layout frame object. You can change frame properties to modify the
properties
u
bd
Aarrangements of items within a data block. The main frame properties are as follows:
• Layout Data Block: Specifies the name of the data block with which the frame is
associated. The items within this data block are arranged within the frame.
Note: A data block can be associated with only one frame. You cannot arrange a block
item within multiple frames.
• Update Layout: Specifies when the frame layout is updated. Valid settings are:
- Automatically: The layout is updated whenever you move or resize the frame, or
modify any frame layout property.
- Manually: The layout is updated whenever you use the Layout Wizard to modify the
frame, or in the Layout Editor, when you click Update Layout or select the Layout >
Update Layout menu option.
- Locked: The layout is locked and cannot be updated.
Order
Form
layout
style
Item
Tabular
a b le
er
layout
style
sfan
- t r
n on
Distance
between
s a records
a
) h ideฺ
m
co t Gu
i l ฺ
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a i
f se(continued)
Controlling Frame Properties t
K
el Specifies en the layout style for the items within the frame. Choose between
• LayoutH Style:
l i c
u l ah and Tabular styles.
Form
d
Ab• Distance Between Records: Specifies the physical distance (measured in the form’s
coordination system units) with which to separate records displayed in the frame
• X/Y Position: Specifies the x and y coordinates (measured in the form’s coordination
system units) of the frame’s position on the canvas
• Width/Height: Specifies the width and height of the frame (measured in the form’s
coordination system units)
Note: You can arrange a frame as well as the objects within it manually in the Layout Editor.
Two palettes for one item: Two palettes for two items:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Displaying Multiple a fi sePalettes
Property t
K
elProperty enPalette for One Object
More Than H One
l i c
You u l
may ahwant to see more properties for an object than there is room for in a single Property
bd To display the properties of an object in multiple Property Palettes, perform the
APalette.
following steps:
1. Open a Property Palette for the object.
2. Press and hold the Shift key and double-click the object icon for the object in the Object
Navigator or the Layout Editor.
More Than One Property Palette for Multiple Objects
You may want to display properties for multiple objects simultaneously. To display the Property
Palettes for multiple objects at the same time, perform the following steps:
1. Open the Property Palette of the first object.
2. Click Pin/Unpin on the toolbar to “freeze” this palette.
3. Invoke the Property Palette for another object. This Property Palette appears in a separate
window.
If the second window is on top of the first one, drag it so that both windows are visible.
Intersection/
Union
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Properties on a i
fMultiple e t
Objects
K
el set the en s
You can view
h Hand
l i c properties of several objects simultaneously, whether they are the same
d u la object types. You can select the objects in the Object Navigator and display a
or different
Ab Intersection:
combination of the properties in the Property Palette. The combination may be:
A subset in which you display only the common properties of the selected
objects (This is the default set operator.)
Union: A superset in which you display both the common properties and the unique
properties of the selected objects
Where there are differing values for a property across the selected objects, you see ***** in the
property value. This changes to a definitive value after you enter a new value in the Property
Palette. This new value then applies to each of the selected objects to which the property is
relevant.
highlighted.
3. Set the Intersection/Union button from the toolbar in the Property Palette to the desired
operation. This button toggles between the two options.
4. Change the displayed properties, as required. Your changes are applied to all selected
objects with these properties.
Note: With a union, you may see some properties that are not relevant to all of the selected
objects. Changes to a property are applied only to objects that have the property.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Copying Properties
Copy Paste
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Name ITEMS
Query All Records No Query All Records Yes
Query Allowed Yes Query Allowed Yes
Insert Allowed Yes Insert Allowed Yes
Update Allowed Yes Update Allowed No
Delete Allowed Yes Delete Allowed Yes
a b le
er
Properties
an sf
- t r
on
s an
) ha deฺ
c o m Gui
Source objects
m ailฺ denDestination
t objects
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Copying Properties afi e t
K
el properties s
enand values from the Property Palette to a buffer, so that they can be
You can copy Hthe
l i c
h to other objects in your design session. To copy properties, perform the
appliedla
(pasted)
u
bd steps:
Afollowing
1. In the Property Palette, display and set the properties that are to be copied. This may be
from one object or a combination of objects.
2. Select the properties to be copied:
- To copy all property settings from the Property Palette, select Edit > Select All.
- To copy the selected property settings only, press and hold [Ctrl] and select each
property individually.
2. Click Copy Properties on the toolbar of the Property Palette.
3. From the Object Navigator, select the object into which the properties are to be copied.
4. In the Property Palette, click Paste Properties. The selected object receives values from all
copied properties that are relevant to their object types.
Note: It is possible to copy the property settings of an object to objects of different types. In this
case, properties that do not apply to the target object are ignored.
Objects can inherit some of their properties from a linked property class, so their properties
change automatically if the associated properties are changed in the property class.
Property classes are discussed in more detail in a later lesson.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Deleting Blocks a fi se t
K
el perform n following steps:
ethe
To delete a block,
H l i c
l ah the block to be deleted in the Object Navigator.
1. Select
u
d Click the Delete icon on the toolbar, or press [Delete].
Ab2.3. An alert is displayed for delete confirmation. Click Yes to delete the block.
Note: Deleting a block also deletes its subordinate objects (items and triggers). If the block was a
master or detail block in a relation, the relation is also deleted. However, the frame border and its
title will remain. Delete the frame manually in the Layout Editor.
Summary
( k afi o use
Summary a fi se t
K
eldata block enproperties in its Property Palette to change its behavior at run time.
• ModifyH the
l i c
l
• Data
u ahblocks have Navigation, Database, Records, Scrollbar, and other properties.
d
Ab• Database properties include WHERE Clause, Query Data Source Type, and Maximum
Records Fetched.
• You can change frame properties to modify the arrangements of items within a data block.
• You can copy properties between data blocks and other objects.
• You can view and change the properties of several objects together. You can use
Intersection or Union settings to connect their properties in the Property Palette.
Practice 6: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Text Itemafi e t
K
ea ltext item s
ebyn doing one of the following:
You can create
H l i c
l ah
• Converting
u an existing item into a text item
d
Ab• Using the CreateItem
• Using the Text tool in the Layout Editor
icon in the Object Navigator
• Using the wizards
How to Create a Text Item in the Layout Editor
1. Invoke the Layout Editor.
It is important to point to the correct data block where you want to create the text item. In
the Layout Editor, select the data block from the Block pop-up list.
2. Click the Text Item tool.
3. Click the canvas.
The text item appears.
4. Double-click the text item.
The text item Property Palette appears.
5. Set the item properties as required.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Modifying the Appearancea fi sofea tText Item
K earendivided into several groups.
The properties
H oflan item
e i c
l
h the way the text item is displayed by altering its General, Physical, Records, Font,
You u l
can aaffect
bdColor group properties. To view descriptions of any of these properties, click the property in
Aand
the Property Palette and press [F1]. The following are some of the properties:
• General:
- Item type: Selects the type of item you want to create (pop-up list)
• Physical:
- Visible: Determines whether the item is displayed
- Canvas: Determines the canvas on which the item is displayed. If left unspecified, the
item is said to be a Null canvas item, and will not display at run time or in the Layout
Editor.
- X and Y Position: Sets the x and y coordinates of the item relative to the canvas
- Width and Height: Sets the width and height of the item in the current form
coordinate units
- Bevel: Controls appearance of bevel around the item; can also be set to Plain (flat) or
None
Orders
Items
Distance a ble
er
between
an sf
records - t r
on n
Number s a
of items ) ha deฺ
displayed c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi sofea tText Item (continued)
Modifying the Appearance
K
el licen
• Records: H
l-ahCurrent Record Visual Attribute Group: Specifies the name of the visual attribute to
d u
Ab -
use when the item is part of the current record
Distance between records: Specifies the amount of space between instances of the
item in a multirecord block
- Number of Items Displayed: Specifies the number of item instances that are displayed
for the item when the item is in a multirecord block
• A prompt specifies
the text label that is
associated with an
item.
• Several properties are
available to arrange
and manage prompts.
a b le
• Use prompt fer
properties to change a n s
- t r
the appearance n onof an
s
item prompt.
a
h a ฺ
o m )
u ide
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Modifying the Appearance i
f sofea tText Item (continued)
K en of the prompt, or label, of a text item using properties in the
l appearance
ethe
You can control
H l i c
l
following
u ahgroups:
d
Ab• Prompt: You can set the prompt text and other properties, such as:
- Display Style: Pop-up list with choices of First Record, Hidden, and All Records
- Attachment Edge: Specifies the item edge to which the prompt is attached
- Attachment Offset: Specifies the distance between the item and its prompt
• Prompt Color: The property in this section specifies the foreground color for the item
prompt. You can select this from a color picker.
• Prompt Font: The properties in this section determine the font that is used for the item
prompt, along with its size, weight, style, and spacing. You can double-click the Prompt
Font group to display a Font dialog box, which enables you to set all these properties at
once. Alternatively, you can click the individual properties to select each from an
appropriate control, such as a pop-up list or LOV.
1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
2 4
a nsf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Associating Text witha fian Item
s e t
Prompt
K
el Layout n has a tool called Associate Prompt, which enables you to
eEditor
The Forms Builder
H l i c
h for an item using any boilerplate text displayed in the editor. To create a prompt-
create alaprompt
u
bd association using the Associate Prompt tool, perform the following steps:
Aitem
1. Open the Layout Editor window.
2. Select the item and boilerplate text you want as the item’s prompt in the editor.
3. Click the Associate Prompt tool.
4. If you are replacing an existing prompt, click Yes in the dialog box.
a b le
er
US7ASCII an sf
1 2 3 4 5 - t r
on
VARCHAR2(5 CHAR)
JA16SJIS a n
VARCHAR2(5 CHAR) 1 2 3 ha4 s ฺ 5
)
m Guid e
UTF8 o
VARCHAR2(5 CHAR) 1 2 ailฺ3 nt c
g m tude
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Controlling the Dataaof i
f a Text e t
Item
K s
n of the text item are used to control the way data is displayed
The properties
H inlthe Data
e i c egroup
l
l ah You can see descriptions of any of these properties by clicking the property in the
and entered.
u
bd Palette, and then by pressing [F1]. The following are some of the properties:
AProperty
• Data Type: This enables you to choose CHAR, DATE, DATETIME, and NUMBER; the
others listed are for backward compatibility.
• Data Length Semantics: You can set to Null, BYTE, or CHAR to be compatible with
multiple character sets. If Data Length Semantics is CHAR, the correct amount of storage
will be automatically allocated as required for the Maximum Length with either a single-
byte or multibyte character set.
• Maximum Length: You can use this to specify the maximum length of the data value that
can be stored in an item. If the Maximum Length exceeds the display width of the item,
Forms automatically enables the end user to scroll horizontally.
Note: In the example in the slide, whether the form operator is using a single-, double-, or
variable-byte character set, the right amount of storage is allocated. To hold the same value
if the Data Length Semantics had been set to BYTE, the Maximum Length would have
needed to be 5 for single-byte, 10 for double-byte, and an unknown value for a variable-
byte character set.
Format masks:
• Standard SQL formats
– Dates FXDD-MON-YY
– Numbers L099G990D99
• Nonstandard formats: Use
double quotation marks for
embedded characters,
a b le
“(“099”)”099“-”0999. er
an sf
Note: Allow for format mask’s - t r
on
embedded characters when
s an
defining Width property. ) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Controlling the Dataaof fi a Text
s e t (continued)
Item
K
el You n specify any format mask that is valid for the data type.
ecan
• FormatHMask:
l i c
u l
Useahthe Format Mask property to specify the format in which the user sees the item value.
d
Ab - Use standard SQL formatting syntax for dates and numbers (for example,
DD/MM/YY and $99,999.99).
- Enclose non-SQL-standard embedded characters in double quotation marks (for
example, hyphen [-] and comma [,]).
Note: It is recommended that you avoid creating individual masks if the general purpose
masks (see the lesson titled “Working in the Forms Developer Environment”) will suffice.
• FX Format Mask: The FX format mask in a date value ensures that the date is entered
exactly as defined in the mask. Element D is for decimal and G is a group (thousands)
separator.
Example: With a date format of DD/MM/YY, valid entries are 10/12/00, 10 12 00, 10-
DEC-00, or 101200. You can enter any character to represent the (/) in the value. Allow for
the embedded characters of the format mask when defining the Width property. The
embedded characters are used only for display purposes and are not stored in the database.
Initial values:
• Are used for every new record
• Can be overwritten
• Must be compatible with item’s data type
• Use:
– Raw value
– System variable a ble
er
– Global variable an sf
- t r
– Form parameter on
– Form item s an
) ha deฺ
– Sequence
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Controlling the Dataaof fi a Text
s e t (continued)
Item
K
l specifies
eThis en whether Forms will allow the item to have a null value. When
• Required: H l i c
u l
youahcreate a data block, Forms derives this value from the existence of a NOT NULL
d
Ab• constraint on the database column, but you can change the value.
Lowest/Highest Allowed Value: You can use this to specify the range of accepted values.
• Initial Value: This specifies default value assigned to an item whenever a record is
created; can be set to select from a sequence; must be compatible with the item data type. If
the Lowest/Highest Allowed values are specified, the initial value cannot be outside the
range.
• System variable
- Variables giving current application server operating system date/time:
Variable Format
$$DATE$$ DD-MON-YY
$$DATETIME$$ DD-MON-YYYY hh:mi[:ss]
$$TIME$$ hh:mi[:ss]
<data_block_name>.<item_name>
Dept
ID 31 Region ID 1
Name Sales
Employee
( k a ou
Controlling the Dataaof i
f a Text e t (continued)
Item
K s
en This specifies the source of the value that Forms uses to populate
el fromlicItem:
• Copy Value
H
l
the h When you define a master-detail relation, Forms Builder sets this property
aitem.
d u
Ab automatically on the foreign key items in the detail block. In such cases, the Copy Value
from Item property names the primary key item in the master block whose value gets
copied to the foreign key item in the detail block whenever a detail record is created or
queried.
Note: The text item should disable input; otherwise, the user could violate the foreign-key
relationship. To prevent this, set the Enabled property to No for the foreign-key item, or do
not display it at all.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Controlling the Dataaof fi a Text
s e t (continued)
Item
K en You can use this property to specify the name of the item from
el withlicItem:
• Synchronize
H
u l ah the current item should derive its value and to synchronize the values of the two
which
d
Ab items, so that they effectively mirror each other. When the end user or the application
changes the value of either item, the value of the other item also changes.
• Established by order of
entries in the Object
Navigator
• Alter by:
– Keyboard Navigable
– Previous Navigation Item
– Next Navigation Item
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Controlling the Navigational fi seBehaviort of Text Items
l K e n
You can see H theedefaultic navigational sequence of items in the Object Navigator because the item
h l
a displayed in the navigational order. However, you can also use the Navigation group
entries lare
u
d
Ab
properties to control the navigational behavior of a text item.
Case
Restriction=
Enabled=No Upper
Order
Payment
Order ID 100 Type CREDIT
Item
Justification = Right
a ble
er
ID Product ID Price Quantity Item Total
sf
an
1 10011 135 500 67,500.00
n - t r
2 400 o
10013 380
a n 152,000.00
a s
Justification = Start
m ) h ideฺ
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Adding Functionality a i
fto a Texte tItem
K s
en of a text item by introducing some of the additional features
el functionality
Augment theH default
l i c
h in the Functional group of the Property Palette. Some of these are depicted above or
you canlaset
u
bdbe discussed in the next few pages. For descriptions of other properties in the Functional
Awill
group, select the property in the Property Palette and press [F1].
Note
• If the Enabled property set to No, the item is disabled. If you want the item to appear
normally but do not want users to change it, then do the following:
- Set Insert Allowed to No.
- Set Update Allowed to No.
- Set Enabled to Yes.
• A pop-up menu is a context-sensitive menu that enables users to access common functions
and commands quickly. It is a top-level object in the Object Navigator and belongs to a
form module (as opposed to a form menu, which belongs to a separate menu module).
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Adding Functionality a ftoi a Text
s e tItem (continued)
K
l characters
eHides en that the operator types into the text item. This setting is
Conceal Data: H l i c
h for password protection. Choose Yes to disable the echoing back of data entered
l
typically
u aused
d
Abyb the operator; with this setting, the entered value is displayed as an asterisk for each character
entered.
Note: Conceal Data set to Yes is valid only for single-line text items.
( k a ou
a
Setting Keyboard Navigable i
f seandt Enabled Properties
l K
eKeyboard n
eNavigable
You can set the
h H l i c and Enabled properties for items to specify whether
d u la can navigate to and interact with them. The Enabled property determines whether end
operators
b
users can use the mouse to manipulate an item. The following table describes the behavior of
Acombinations of these settings:
Keyboard
Enabled Navigable Navigation Behavior
Yes Yes Item is included during default navigation. The item can be
navigated to and manipulated with the mouse.
Yes No Item is excluded during default navigation. The item can be
navigated to and manipulated with the mouse.
No No Item is excluded during default navigation. The item cannot
be navigated to and manipulated with the mouse.
No Yes Item is excluded during default navigation. The item cannot
be navigated to and manipulated with the mouse. The
Keyboard Navigable property is also effectively set to No.
Text
a b le
er
Text
an sf
- t r
Height
Text on
s an
Text
) ha deฺ
c o m Gui
m ailฺ dent
Width
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Adding Functionality a ftoi a Text
s e tItem
K
el licwhether en the text item displays in a single-line or multi-line region. Use
Multi-Line:H Determines
l ahtext items to display and/or edit such items as addresses, comments, or descriptions.
multi-line
u
bddata in a multi-line text item must be of Char, Alpha, or Long data type; not numeric or
AThe
date.
Setting the Multi-Line property to Yes enables a text item to store multiple lines of text, but it
does not automatically make the item large enough to display multiple lines. You can set the
Width, Height, Font Size, and Maximum Length properties to ensure that the desired number of
lines and characters are displayed.
Note: Setting right or center justification for scrollable text items may result in values being
hidden from the user.
Wrap Style: For multi-line text items, specifies how text is displayed when a line of text
exceeds the width of a text item or editor window.
a ble
er
Tooltip an sf
- t r
on
Hint
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Displaying Helpful Messages
K
l group enproperties to provide context-sensitive help to users:
theeHelp
You can use H i c
l
Helpu l ah
Property Function
bd
AHint Writes item-specific Help text that is displayed on the
message line at run time. The Help text is available when
input focus is on the item.
Display Hint Automatically Determines whether the hint for the item is displayed
automatically. If set to No, the hint displays only when the
operator presses [Help] or selects the Help command on the
default menu.
Tooltip Help text that should appear in a small box beneath the item
when the cursor is moved over the item. The item does not
need to have input focus for the tooltip to appear.
Tooltip Visual Attribute Specifies Visual Attribute to use for the tooltip
Group
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Summary
( k a ou
Summary (continued) a i
f se t
K enproperties that enable you to do the following:
elitemslihave
In particular,H
text c
l ah their appearance.
• Modify
u
d
Ab• Control the data stored in the item.
• Alter navigational behavior.
• Enhance the relationship with the database.
• Add functionality.
• Include Help information.
Practice 7: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 7: Overviewafi e t
l K
esession, s
enwill create text items, alter the behavior and the appearance of text
In this practice
H l i c
you
l
items, and
u ahdelete text items.
d
Ab•• Delete the region ID item in the CUSTOMERS form.
Using the Property Palette, change the properties of several text items in the CUSTOMERS
data block to change their run-time appearance. Save and run the form after the changes are
applied.
• In the ORDERS form, create new text items to hold the customer name and sales rep name
values in the ORDERS block, and set the suggested properties. Change additional text item
properties in the ORDERS, ORDER_ITEMS, and INVENTORIES data blocks to change
their run-time appearance and behavior. Save and run the form after the changes are
applied.
Note: For solutions to this practice, see Practice 7 in Appendix A, “Practice Solutions.”
it cannot be changed.
Use the CUSTOMERS_SEQ sequence.
4. In the CUSTGXX form, resize and reposition the items. Add the boilerplate text Customer
Information. Reorder the items in the Object Navigator. Use the screenshot as a guide.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
5. Save and compile your form.
f i ฺ rub se th
( k a Run
Test the changes byi clicking o uForm to run the form.
f
aformnmay t
enot be visible at this time. This will be addressed in a later
K
Note: The entire
l e s
lesson.He lic
l a h
A bdu
13. In the INVENTORIES block, alter the number of instances of the Product_ID, so that itaisble
displayed just once. Make its prompt display to the left of the item. s f er
anscreenshot.
14. Arrange the items and boilerplate on CV_INVENTORY, so that it resemblestrthe
-
Hint: Set the Update Layout property for the frame to Manually. non
s a
a
) h ideฺ
m
co t Gu
i l ฺ
g ma tuden
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A 15. Save, compile, and run the form to test the changes.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Editor
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
LOV le
r a b
sf e
t r an
on -
s an
Supporting data ) ha deฺ
c o m Gui
record group
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
fi se t
What Are LOVs andaEditors?
K
l and
e(LOVs) n are objects in a form module that you can associate with text
eeditors
Lists of values
H l i c
h input. Each opens its own window when activated at run time.
l
items to
u aenhance
bd enable users to choose a value from a static or dynamic list, while editors provide a larger
ALOVs
area for text entry with search and replace capability. Both are defined at the form level, which
means that you can use them to support text items in any block of the form module.
• LOVs:
– List of values for text
items
– Dynamic or static list
– Independent of single
text items
– Flexible and efficient LOV lamp
a b le
• Editors: er
an sf
– Override default editor - t r
n
– Used for special requirements such as larger on
s a
editing window, position, color, and
h a
title ฺ
o m )
u ide
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
What Are LOVs andaEditors? i
f se(continued)t
K
el licen
LOVs H
An LOV
u l aish a scrollable pop-up window that enables a user to pick the value of an item from a
bd
Amulticolumn dynamic list. The user can reduce the lines displayed in the list by simple automatic
reduction techniques, or by search strings.
Each line in an LOV can present several field values, with column headings above. You can
design your LOV to retrieve some or all of the field values from the line chosen by the user and
place them into form items.
LOVs have the following qualities:
• Dynamic: The list entries can change to reflect changes in the source data.
• Independent: The designer can invoke an LOV from any text item, or from outside a text
item if called programmatically.
• Flexible: You can use the same LOV to support several items, if appropriate (for example,
product_ID, product_name).
• Efficient: You can design LOVs to reuse data already loaded into the form, instead of
accessing the database for every call. This is useful where data is relatively static.
LOV LOV
( k afi o use
LOVs and Record Groupsa fi se t
K
eanl LOV, n the following objects:
econsider
When you build
H l i c
l ah group: A Forms Builder object that is used to store the array of values that are
• Record
u
d
Ab presented by an LOV (The record group can be created first or as part of the LOV creation
process if based on a query.)
• LOV: The list itself, which presents one or more column values from the supporting record
group in the LOV window (It enables the user to select values, and then write values back
to specified items or variables.)
• Text items: The main text item that you attach to an LOV is usually one that the LOV
returns a value to. You can call the LOV from this item to provide possible values for it. A
single LOV can return values to several items. You can attach the LOV to any text item
from which the same list of values needs to be viewed, whether or not it will receive a
value.
1 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
3 4 er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV Manuallya fi se t
l K
eBuilder enan LOV Wizard for you to use in creating LOVs and their associated
Because Forms H l i c
has
ah you may never need to create an LOV manually. However, knowing how to do so
record lgroups,
u
bd you to understand how to set the properties of the record group, the LOV, and the item to
Ahelps
which it is attached, even if using the Wizard.
The steps to create an LOV manually are the following:
1. Create the record group. You will need to enter the query on which the record group is
based.
2. Create the LOV and set its Record Group property to the appropriate record group.
3. Set the LOV property Column Mapping. You must enter the columns and their headings,
and then select a return item for each item that you want to populate from the LOV.
4. Assign the LOV to any text items from which you want the LOV to be available.
Edit query
if needed
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV with a i LOV
fthe e t
Wizard
K
el a mistake s
enor to forget one of the manual steps. This can be avoided by using
It is easy to make
h H l i c
the LOV
u l aWizard, which guides you through the process. To create an LOV with the wizard,
d
Ab1. Launch the LOV steps:
perform the following
Wizard.
The Welcome page appears. Click Next. The LOV Source page appears.
2. Specify the LOV source on the LOV Source page. Choose an existing record group or
create a new one based on a query. The default option is New Record Group based on a
query. Click Next to select the default. The SQL Query page appears.
3. On the SQL Query page, specify the query that is used for the record group. You cannot
include a column of a complex object data type. Use one of the following three options for
constructing the query:
- Click Build SQL Query to use Query Builder.
- Click Import SQL Query to import the query from a file.
- Enter the SQL syntax in the SQL Query Statement field to enter the query directly.
Then click Check Syntax.
After defining the query, click Next. The Column Selection page appears.
Note: See Appendix C for more information about Query Builder.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV with a i LOV
fthe e t
Wizard (continued)
l K
e Selection n s
e page, select the record group columns that you want to include in
4. On the H
Column
l i c
h Click Next. The Column Properties page appears.
l
the
u aLOV.
d
Ab
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV witha i LOV
fthe e t
Wizard (continued)
l K
e Properties n s
e page, specify the title, width, and return value for each LOV
5. On the H
Column
l i c
l ah Note that Return Value is optional. Click Next. The LOV Display page is
column.
u
d
Ab displayed.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV with a i LOV
fthe e t
Wizard (continued)
l K
e Display n s
epage, specify the title, the width, and the height of the LOV window.
6. On the HLOV
l i c
l
You
u ahcan choose to display it at a set position that you manually define, or let Forms
d
Ab position it automatically. Click Next. The Advanced Options page appears.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV with a i LOV
fthe e t
Wizard (continued)
l K
e liOptions n s
e page, set the additional advanced properties. Specify:
7. On the H
Advanced c
l-ahThe number of records at a time to be fetched from the database
d u
Ab -- IfIf the LOV records should be queried each time the LOV is invoked
the user should be presented with a dialog box to add criteria before the LOV is
displayed
Click Next. The Assign to Item page appears.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an LOV with a i LOV
fthe e t
Wizard (continued)
l K
e tolItem n s
e page, select the items to which your LOV should be attached. At run
8. On the H Assign i c
l ahthe LOV is available from these items so that operators may use it while input focus
time,
u
d is in one of these items. Click Next. The Finish page appears.
Ab9. On the Finish page, click Finish to complete the LOV creation process.
Note: The LOV Wizard is reentrant, so you can use it to modify the LOV after it is created. In
the Object Navigator, click the LOV to be modified, and choose Tools > LOV Wizard from the
menu.
LOV Properties
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
(X,Y) Width
LOV
Height Automatic
Select
( k a ou
Setting LOV Properties a i
f se t
K
l LOV,ceopen
ean n its Property Palette to define its properties. Some of these
After you create
H i
l
l ahare the following:
properties
u
d and Y Position: Specify screen coordinates for the LOV window in the form coordinate
Ab• Xunits
• Width and Height: Define size of the LOV window in the current form coordinate units;
can be adjusted by form operator
• Column Mapping: Click the button labeled More to open the LOV Column Mapping
window.
• Filter Before Display: Determines whether the user should be prompted with a dialog box
that enables the user to enter a search value before the LOV is invoked; value will be used
as additional restriction on the first column in the query
• Automatic Display: Controls whether LOV should be invoked automatically when form
operator enters an item to which the LOV is attached
• Automatic Select: Specifies if LOV should close and return values automatically when
reduced to single entry
• Automatic Skip: Determines whether cursor skips to next navigable item when operator
selects a value from LOV to populate text item
Automatic
LOV Column Width
Automatic
Position
Column Mapping
a b le
er
an sf
- t r
on
s an
) ha deฺ
Return Items
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting LOV Properties a fi (continued)
s e t
K
elRefresh: eIfnYes, record group reexecutes query every time LOV is invoked; if
• AutomaticH l i c
l
No,
u ahquery fires only first time LOV is invoked in the session
d
Ab• Automatic Position: Determines whether Forms automatically positions LOV near item
from which it was invoked
• Automatic Column Width: Determines if Forms automatically sets the width of each
column so entire title is displayed if the title is longer than the column display width
Note: More than one LOV can be based on the same record group. When this is the case and you
set Automatic Refresh to No, Forms Builder will not reexecute the LOV query after any of the
associated LOVs is invoked.
Phone number
1-415-555-6281
Hidden
column
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Column Mapping Properties fi se t
K n control button for Column Mapping Properties, the LOV
l Moreceproperty
ethe
When you click
H i
h l
Column
u l aMapping dialog box opens, with the following elements:
d
Ab• Return Item: Specifies
• Column Names: Lets you select an LOV column for mapping or defining a column
the name of the form item or variable to which Forms should
assign the column value. If null, the column value is not returned from the LOV. If you
want to return a value, specify one of the following:
- Block_name.item_name
- GLOBAL.variable_name
- PARAMETER.parameter_name
• Display Width: Width of column display in LOV; value of zero causes column to be
hidden, but value is available for return
• Column Title: Heading for column in LOV window
To set a column mapping in this dialog box, first select the column from the Column Names list,
and then set the other mapping values, as required.
Note: The record group columns and LOV columns must remain compatible.
You can modify the record group query from its own properties list.
Remember that the List of Values lamp is displayed when the user navigates to this text item,
indicating that the LOV is available through the List of Values key or menu command.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Defining an Editor
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Defining an Editor afi e t
K s
n on text values, the default Forms Builder editor is usually
etol uselianceeditor
If the user needs
H
l
sufficient
u ahfor most items. However, you can design your own customized editor as an object in a
bd module, and then attach it to the text items that need it.
Aform
How to Create a Customized Editor
1. Select the Editors node in the Object Navigator, and then click Create. A new editor object
is displayed in the list.
2. Select the new editor in the Object Navigator, and then access its Property Palette, where
you can set its name and other properties.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Defining an Editor (continued)
l K
eproperties en
Setting Editor
H l i c
l ah properties show the individual customization that is possible by creating your own
The following
u
bd
Aeditor:
• Title/Bottom Title: Displays at top or bottom of editor window
• Width/Height: Control size of editor window and, therefore, its editing area
• X/Y Position: Screen position for editor; can be overridden by a text item property
• Wrap Style: How text wraps in the window: None, Character, or Word
• Show Vertical Scrollbar: Specify Yes to add vertical scroll bar to editor window
( k a ou
Associating an Editor a i
f with saeText t Item
K
l with eantext item, you must specify the editor in the Property Palette of the
aneeditor
To associate H i c
l
l
text item.
u ah
bd the text item in the Object Navigator from which the editor is to be accessible.
ASelect
In the item Property Palette, set the Editor property to one of the following settings:
• Null: The text item uses the default Forms Builder editor.
• Editor Name: The text item uses the named editor that you have created and customized in
this module.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k afi o use
Summary a fi se t
K
el learned n lists of values (LOVs) and text editors can be used to support text
ethat
In this lesson,
H you
l i c
l ah LOVs and editors are objects in a form module that open their own window when
items. Both
u
bd at run time and are used to support text items in any block of the form module.
Aactivated
• LOVs and editors can be shared across text items.
• The steps to implement an LOV are the following:
1. Create a new LOV (and record group).
2. Define column mapping for return items.
3. Attach the LOV to text items, as required.
• The LOV Wizard performs these steps automatically.
• Text items can use the default editor or a user-named editor.
Practice 8: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 8: Overviewafi e t
l K
esession, s
enwill create three LOVs and an editor.
In this practice
H l i c
you
l
• Using
u ah the LOV Wizard, create an LOV in the ORDERS form to display product numbers
d and their descriptions. Attach the LOV to the Product_ID item in the ORDER_ITEMS data
Ab block.
• Using the LOV Wizard, create an LOV in the ORDERS form to display Sales
Representatives’ IDs and names. Attach the LOV to the Sales_Rep_ID item in the ORDERS
data block. Save and run the form.
• Using the LOV Wizard, create an LOV in the CUSTOMERS form to display sales
representatives’ numbers and their names. Attach the LOV to the ACCT_MGR_ID item in
the CUSTOMERS data block. Save and run the form.
• In the CUSTOMERS form, create an editor for the Phone_Numbers item.
Note: For solutions to this practice, see Practice 8 in Appendix A, “Practice Solutions.”
Practice 8
1. In the ORDGXX form, create an LOV to display product numbers and descriptions to be
used with the Product_Id item in the ORDER_ITEMS block.
Use the PRODUCTS table and select the Product_Id and Product_Name columns.
Assign a title of Products to the LOV. Sort the list by the product name. Assign a column
width of 25 for Product_Id, and assign the LOV a width of 200 and a height of 250.
Position the LOV 30 pixels below and to the right of the upper-left corner. For the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
What Are Input Items? a fi se t
K
el lterm enfor Forms Builder item types that accept user input.
Input item isHa generic i c
l ah types include the following:
Theseuitem
d
Ab• Check box
• List item
• Radio group
What Can You Do with Input Items?
When you create input items, they already have some initial functionality. Through input items,
you can interact with the database in the following ways:
• Insert values
• Update existing values
• Delete existing values
• Query existing values
Note: You can add functionality to input items with triggers and PL/SQL program units.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
What Is a Check Box? a fi se t
l K n
einterface
is e
A check box H a two-state
i c object that indicates whether a certain value is ON or OFF.
h l
d u la state of a check box is always either checked or unchecked.
The display
b can use check boxes to enhance the user interface by converting existing items that have
AYou
two possible states. Although a check box is limited to two states, it is not limited to just two
values. You specify the value to represent Checked, the value to represent Unchecked, and how
other values are processed.
Using a Check Box at Run Time
You can do the following at run time:
• Set check box values either by user input, by means of the Initial Value property, or
programmatically.
• In Enter Query mode:
- Query checked values by clicking one or more times until item is checked
- Query unchecked values by clicking one or more times until item is unchecked
- Ignore check box values by not selecting or deselecting the initial displayed value
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Check Box a fi se t
K
elbe created enby:
A check boxH can
l i c
l ah
• Converting
u an existing item
d
Ab• Using the Create Box
• Using the Check tool in the Layout Editor
icon in the Object Navigator (creates a text item, which you can convert
to a check box)
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
How to Convert an Existingfi sItem e t into a Check Box
K
elan existingenitem into a check box by changing the Item Type property to Check
You can convert
H l i c
ahProperty Palette and setting other relevant properties. Perform the following steps:
Box inlthe
u
d
Ab1.2. Invoke the Property Palette for the item that you want to convert.
Set the Item Type property to Check Box.
3. Specify a check box label.
4. Specify values for the checked and the unchecked states.
5. Set the Check Box Mapping of Other Values property.
6. Specify an initial value for the check box item.
Note: The check box label that you specify is displayed to the right of the check box element at
run time. If the complete label name is not displayed, adjust it in the Layout Editor. If the item
already has a prompt, delete it in the item Property Palette.
a ble
er
a nsf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
How to Create a Check a fi Boxsine thet Layout Editor
K
el a check enbox by using the Check Box tool in the Layout Editor.
You can alsoH create
l i c
l
1. Invoke
u ah the Layout Editor.
d the canvas and block to those on which you want the check box item to be displayed.
Ab2.3. Set
Click the Check Box tool.
4. Click the canvas in the position where you want the check box to be displayed.
5. Double-click the check box to invoke its Property Palette.
6. Set the properties as required.
• Data Type
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Label
• Access Key
• Value when Checked
• Value when Unchecked
• Check Box Mapping of
Other Values
r a ble
• Mouse Navigate sfe an
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Setting Check Box Properties
K
el licmay en be set to affect the appearance and behavior of check boxes:
The following
H properties
l
• Data
u ahType: Must be compatible with values specified in the Value properties
d
Ab•• Label: Text label displayed next to check box item (independent of check box value)
Access Key: Which combination of keys may be used to navigate to this item and check or
uncheck it
• Initial Value: Initial value of the item for new record, determining whether check box is
initially checked or unchecked
• Value when Checked: Value to represent checked state of the check box
• Value when Unchecked: Value to represent unchecked state of the check box
• Check Box Mapping of Other Values: How other values are to be processed (NOT
ALLOWED, CHECKED, or UNCHECKED)
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
ORDER_MODE Checked
Y Y
Y Unchecked
N
N
Null
a ble
er
A Check Box Mappingnof
a sf
- tr
Other Values
n
a no
Unchecked
h a s ฺ
o m )
u ide
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Check Box Mappingaof i
f Other e t
Values
K
el Values en s
Dealing withHOther
l i c
If your
u l ah
base-table column accepts other values, then your check box should account for them.
b
Youd can assign other values to either the checked or unchecked states by using the Check Box
A
Mapping of Other Values property. Alternatively, you can choose not to accept other values with
the Not Allowed setting.
Note: If you choose not to accept other values and they exist in the base-table column, then
Forms ignores the entire record during query processing.
Dealing with Null Values
If your base-table column accepts null values, you can account for them by one of the following
methods:
• Set the Check Box Mapping of Other Values property.
• Set the checked or unchecked state to represent null (leave the value blank).
a b le
er
an sf
- t r
• Space-saving alternative to a radio groupn on
a
• Smaller-scale alternative to an LOVhas eฺ
m ) id
c o G u
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
What Are List Items? a fi se t
l K en that displays a predefined set of choices, each corresponding to a
A list item isHaneinterfacei cobject
l
h value. You use the list item at run time to select a single value. List choices or
specificladata
u
bd are mutually exclusive; one and only one can be selected at a time.
Aelements
The Three List Item Styles
• Poplist: Appears as a field with an iconic button attached to the right (When you click a
poplist, all its list elements are displayed.)
• Tlist: Appears as a rectangular box that displays the list elements (When the display area is
not big enough to display all the list elements, a scroll bar is automatically attached to the
right to view the remaining list elements.)
• Combo box: Appears as a field with a down arrow next to its right (Use the button to
display all the combo box list elements. The combo box accepts user input.)
List items:
• Enable display of a defined set of choices
• Display a set of choices without using a vast area of canvas
• Provide an alternative to radio groups
• Provide a Windows-style list of values
Setting the Value for a List Item
The value for a list item can be set in any of the following ways:
• User selection
• User input (combo box style only)
• A default value r a ble
• Programmatic control n s fe
- tr a
no n
s a
a
) h ideฺ
m
co t Gu
i l ฺ
g ma tuden
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a List Itemafi e t
K
ebel created eby:n s
A list item can
H l i c
l ah
• Converting
u an existing item
d
Ab• Using the Create
• Using the List Item tool in the Layout Editor
icon in the Object Navigator (This creates a text item that you can convert
to a list item.)
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
How to Convert an Existingfi sItem e t to a List Item
K
elan existingenitem to a list item by changing its Item Type property to List Item
You can convert
H l i c
l ahthe relevant properties.
and setting
u
d
Ab2.1. Invoke the Property Palette for the item that you want to convert.
Set the Item Type property to List Item.
3. Select the Elements in List property.
4. Click More.
The List Item Elements dialog box appears.
5. Enter the element that you want to display in your list item in the List Elements column.
6. Enter the value for the currently selected list element in the List Item Value field.
7. Create additional list elements and values by repeating steps 5 and 6.
8. Click OK to accept and close the List Item Elements dialog box.
9. Set the Other Values property to do one of the following:
- Reject values other than those predefined as list values.
- Accept and default all other values to one of the predefined list element values.
10. Enter an initial value for the list item.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
How to Create a ListaItem fi insthe e t Layout Editor
K
el a list en by using the List Item tool in the Layout Editor.
You can alsoH create
l i citem
l
1. Invoke
u ah the Layout Editor.
d the canvas and block to those on which you want the list item to be displayed.
Ab2.3. Set
Select the List Item tool.
4. Click the canvas in the position where you want the list item to be displayed.
5. Double-click the list item to invoke its Property Palette.
6. Set the properties as required.
Technical Note
To obtain a list of available functions when defining list elements, press [Ctrl] + K while the
input focus is in the List Elements window. The Keys window may appear behind the List
Elements window; if so, just move the List Elements window so that you can see the Keys
window.
• Elements in List:
– List elements
– List item value
• List Style
• Mapping of Other Values
• Mouse Navigate
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Setting List Item Propertiesfi se t
K en More opens List Item Elements dialog box, where you specify:
einl List:licClicking
• Elements H
l-ahList Elements: List elements that display at run time
u
d - List Item Value: Actual value that corresponds to the list element
Ab• List Style: Display style of list item (Poplist, Tlist, or Combo Box)
• Mapping of Other Values: How other values are processed
• Mouse Navigate: Whether Forms navigates to the item and moves input focus to it when
the user activates the item with a mouse
( k a ou
List Item Mapping ofaOther i
f sValues e t
K en
einl a ListlicItem
NULL Values H
l ah column for a list item accepts NULL values, Forms Builder creates a
If theubase-table
bd
Apseudochoice in the list to represent the null.
All three list styles display a blank field if a query returns a NULL value. If the Data Required
property is set to No:
• A poplist displays a blank element for a NULL value
• The user can omit a selection for a TList or can press [Clear Field] to deselect all list
elements. This sets the list item to NULL.
• A combo box does not display a blank element. The end user must delete the default value
if the default value is not NULL.
Handling Other Values in a List Item
If the base-table column for a list item accepts values other than those associated with your list
elements, you must specify how you want to handle the values. Do this in one of the following
ways:
• Ignore other values by leaving the Mapping of Other Values property blank.
• Associate the other values with one of the existing list elements (by naming either the list
element or its associated value) in the Mapping of Other Values property.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
What Are Radio Groups? fi se t
K
elan item en a set of radio buttons represents the possible values for the item.
A radio group
H is
l i cwhere
l ah and hence their corresponding radio buttons are mutually exclusive.
These values
u
bd and Benefits of Radio Groups
AUses
Radio groups:
• Provide a choice between two or more static values
• Provide an alternative to list items that have only a few choices
• Provide a choice between two alternatives, where choice is not On/Off or Yes/No (for
example, Landscape or Portrait print format)
Note: Consider list items instead of radio groups if there are more than four or five choices.
Using a Radio Group at Run Time
You can do the following at run time:
• Set radio group values:
- By user input
- By means of the Initial Value property
- Programmatically
• Query individual radio button values.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Radio Group a fi se t
K
el be created enby:
A radio groupH can
l i c
l ah
• Converting
u an existing item to a radio group
d
Ab none exists) radio button in the Layout Editor (automatically creates a radio group if
• Creating a new
• Using the Create icon in the Object Navigator (This creates a text item that you can convert
to a radio group.)
a ble
er
an sf
- t r
n on
Change Item Type and s
Create radio abuttons for
set other properties.
a eฺ
) hradioidgroup.
the
l ฺ c om t Gu
m ai den
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
How to Convert an Existing fi sItem e t into a Radio Group
K
elan existing enitem to a radio group by changing the item type and setting the
You can convert
H l i c
l
properties
u ahfor a radio group.
d
Ab1.2. Invoke the Property Palette for the item that you want to convert.
Set the Item Type property to Radio Group.
3. Set the Canvas property to the Canvas on which you want the radio buttons to appear.
4. Set the Mapping of Other Values property to specify how the Radio Group should handle
any other values.
5. Set the Initial Value property, as required. This should be the name of a radio button.
6. Expand the item node in the Object Navigator.
The Radio Buttons node appears.
7. Select the Radio Buttons node and click the Create icon.
A radio button displays in the Object Navigator and the Property Palette takes on its
context.
8. Enter a name, value, and a label for the radio button.
9. Specify the display properties of the radio button.
10. Create additional radio buttons by repeating steps 6 through 9.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
How to Create a Radio a fi Groups e int the Layout Editor
K
el a radio n by using the Radio Button tool in the Layout Editor.
egroup
You can alsoH create
l i c
l
1. Invoke
u ah the Layout Editor.
d the canvas and block to those on which you want the radio group to be displayed.
Ab2.3. Set
Click the Radio Button tool.
4. Click the canvas at the desired location for the radio group.
If you already have a radio group in the current block, the Radio Groups dialog box appears
and you must decide whether the new radio button should appear in the existing group or a
new one. If you select New, the new radio group is created implicitly.
5. Double-click the radio button to invoke its Property Palette.
6. Set the radio button properties as required.
Note: The canvas property for a radio group is set in the Property Palette of the radio group. The
individual radio buttons do not have a canvas property.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Item Properties a fi for sRadio
e t Group Items and Radio Buttons
K
ethel following enproperties for radio groups:
You should set
H l i c
l
• Data
u ahType: Must be compatible with Mapping of Other Values for the Radio Group, and
d
Ab• Radio Button Value for each Radio Button in the group
Mapping of Other Values: How values other than those specified are processed
• Mouse Navigate: Whether Forms navigates to the item when the operator activates the
item with the mouse
You should set the following properties for radio buttons:
• Label: Text that appears adjacent to the radio button (independent of the button value)
• Access Key: Which combination of keys can be used to navigate to and manipulate this
radio button
• Radio Button Value: The value for this item if this radio button is selected
LOW_BUTTON
500 Low
MEDIUM_BUTTON
2000 Medium
ble
Null HIGH_BUTTON
s f era
5000 High an- tr
no n
s a
Mapping of
haOtherd)e ฺ
Values
uoim2000
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Radio Group Mapping a i
f of Other e tValues
K
elValues s
ena Radio Group
Handling OtherH l i c in
l ah column for a radio group accepts values other than those associated with your
If theubase-table
bd buttons, then you must use one of the following methods to specify how you want to
Aradio
handle the values:
• Ignore other values by leaving the radio group’s Mapping of Other Values property blank.
• Associate the other values with one of the existing radio buttons by naming the associated
value of the button in the Mapping of Other Values property.
Note: Ignoring other values results in the entire row being ignored during query processing.
NULL Values in a Radio Group
A radio group can treat NULL as a valid value. You should account for the NULL case, if your
base-table column allows null values. You can do this in one of the following ways:
• Use the Mapping of Other Values property to implicitly force NULL to a radio button.
• Assign the NULL to its own radio button by leaving the Radio Button Value property
blank.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
K
el learned n to create items that accept direct user input. Use these items to
ehow
In this lesson,Hyou
l i
h user interface:c
enhance
u l athe
d
Ab• Check boxes: To convert items that have two possible states
• List items (Poplists, Tlists, and Combo boxes): To convert items that have mutually
exclusive choices
• Radio groups: To convert items with two or three alternatives that are mutually exclusive
Practice 9: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 9: Overviewafi e t
l K
esession, s
enwill convert existing text items into other input item types. You will
In this practice
H l i c
you
h item, a check box, and a radio group.
create alalist
u
d the ORDERS form, convert the Order_Status item into a list item. Save and run the
Ab• In form.
• In the ORDERS form, convert the Order_Mode item into a check box item.
• In the CUSTOMERS form, convert the Credit_Limit item into a radio group. Add three
radio buttons in the radio group. Save and run the form.
Note: For solutions to this practice, see Practice 9 in Appendix A, “Practice Solutions.”
Practice 9
1. In the ORDGXX form, convert the Order_Status item into a poplist item.
Add list elements shown in the following table.
Display any other values as Unknown.
Ensure that new records display the initial value New CASH order.
Resize the poplist item in the Layout Editor, so that the elements do not truncate at run
time.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Practice 9 (continued)
4. In the CUSTGXX form, convert the Credit_Limit text item into a radio group.
Add radio buttons for Low, Medium, and High to represent database values of 500, 2000,
and 5000. Arrange as shown in the following screenshot:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Define access keys of L for Low, M for Medium, and H for High.
Add text Credit Limit to describe the radio group’s purpose.
Set Label to Low for the Low radio button, Medium for the Medium radio button, and
High for the High radio button.
Ensure that new records display the default of Low, and that existing records with other
values display as Medium. r a ble
e
5. Save, compile, and run the form to test the changes.
t r ansf
on -
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Introduction a i
f se t
K en
Overview Hel i c
l
l ah Forms Developer item types do not accept user input (noninput items); however,
SomeuOracle
bd do provide an effective means of accessing data and initiating actions. This lesson describes
Athey
how to create and use noninput items.
Display Items
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Display items:
• Are similar to text items
• Cannot:
– Be edited
– Be queried
– Be navigated
to
a ble
er
– Accept user
an sf
input - t r
on
• Can display:
s an
– Non-base-table information ) ha deฺ
c o m Gui
– Derived values
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Display Items a fi se t
K
eislsimilar eantext item, except that it cannot be edited or navigated to at run time.
A display item
H l i cto
l ahitem is a read-only text box whose value must be fetched or assigned
A display
u
bd
Aprogrammatically.
You can use display items to display:
• Additional, non-base-table information
• Derived data values
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Display Item a fi se t
K en by using:
ecanl be created
A display item
H l i c
• The
u l ahLayout Editor
d
Ab• The Create icon in the Object Navigator (creates a text item that you can convert to a
display item)
• The Item Type property to convert an existing item into a display item
You can set the required item properties in the Property Palette. Set the Database Item property
to No for a display item whose value is not stored in the base table. You can assign a format
mask to a single-line display item by setting its Format Mask property.
How to Create a Display Item from the Layout Editor
To create a display item in the Layout Editor, perform the following steps:
1. Invoke the Layout Editor.
2. Display the desired canvas and select the correct data block.
3. Click the Display Item tool.
4. Click the canvas at the position where you want to place the display item.
5. Double-click the new display item to display its Property Palette.
6. Change the Name from DISPLAY_ITEMXX to the desired name.
7. Specify the other properties as needed.
Image Items
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Image Items a fi se t
K
el licen
Using Images H
You u l
can
h images as graphic objects within a form module. A graphic image is displayed
ause
bd
Aautomatically and cannot be manipulated at run time. It can be imported from the database or the
file system.
Alternatively, you can display images within image items.
What Is an Image Item?
An image item is a special interface control that can store and display vector or scanned images.
Just as text items store and display VARCHAR2, number, or date values, image items store and
display images.
Like other items that store values, image items can be either data block items or control items.
You can store images in either the database or the file system.
When you insert images into the database by means of a save (commit), they are automatically
compressed using Oracle image compression.
Read Write
TIFF GIF
GIF TIFF
JFIF BMP
a ble
er
BMP JFIF
an sf
- t r
PICT on RAS
s an
) ha PICTd eฺ
RAS m i
TPIC i l ฺ co t Gu TPIC
m a den
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Image File Formats afi e t
K s
el lictheenfollowing image formats:
Forms Builder
H supports
u
File l ah
Suffix Description Image Items
d
AbBMP MS Windows and OS/2 BitMap Picture Read/Write
CALS CALS type raster Read/Write
GIF CompuServe Read/Write
JFIF JPEG File Interchange Format Read/Write
TIFF Tag Image File Format Read/Write
JPEG Joint Photographic Experts Group Read/Write
PICT Macintosh Quickdraw Picture Read/Write
RAS Sun Raster Read/Write
TPIC Truevision Raster Graphics Array Picture Read/Write
To reduce network traffic, limit the number of image items and background images that must be
downloaded from the application server. You can deploy them as JAR files to reduce network
traffic, or you can download them in an alternative manner.
For example, to display a company logo in your application, you could include the image in the
HTML page that downloads at application startup rather than retrieving the image from the
database or the file system. The HTML page can be cached.
Oracle Forms Developer 10g: Build Internet Applications 10-8
IT Bangla Ltd
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating an Image Item a fi se t
K en in three ways:
ecanl be lcreated
An image item
H i c
h the Image Item tool in the Layout Editor (as described in the
• By
u l ausing
d section)
Ab• next
By using the Create icon in the Object Navigator (creates a text item that you can convert
to an image item)
• By converting an existing item into an image item
Steps to Create an Image Item from the Layout Editor
1. Invoke the Layout Editor.
2. Set the canvas and block to those where you want the item to display.
3. Click the Image Item tool.
4. Click the canvas at the position where you want the image item
to display.
5. Double-click the image item. The Property Palette appears.
6. Change the name from IMAGEXX to the desired name.
7. Specify the other properties as needed.
Note: Remember to set the Database Item property to No for an image item whose value is not
stored in the base table.
• Image Format
• Image Depth
• Display Quality
• Sizing Style
• Show Horizontal
Scroll Bar
• Show Vertical a b le
er
Scroll Bar an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Setting Image-Specific fi ItemsProperties
e t
K
elpropertiesento affect the appearance and behavior of the image item:
Set the following
H l i c
l
• Image
u ah Format: Format in which image is stored in the database
d
Ab• Image Depth: Depth setting for image being read from or written to a file on the file
system (Original, Monochrome, Gray, LUT , or RGB)
• Display Quality: Resolution used to display the image item; controls trade off between
quality and performance (High, Medium, or Low)
• Sizing Style: Determines how much of image is displayed when the sized image does not
match the size of the item (Crop cuts off edges of image so it fits in item display area;
Adjust scales image so it fits within the item display area.)
• Show Horizontal/Vertical Scroll Bar: Displays scroll bars to enable scrolling of image
that does not fit into the item display area
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Push Buttons
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Push buttons:
• Cannot display or represent data
• Are used to initiate an action
• Display as:
– Text button
– Iconic
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Push Buttons a fi se t
K
l interface
ean enobject that you click to initiate an action. A push button is usually
A push buttonH is
l i c
l
displayed
u ahas a rectangle with a descriptive label inside. Push buttons cannot store or display
bd
Avalues.
You can enhance your form module by adding push buttons to provide quick and direct access to
the most needed operations.
Push Button Styles
Forms Builder supports two push button styles:
• Text button: Displayed with a text label on the push button
• Iconic button: Displayed with a bitmapped graphic on the push button, and often used in
toolbars
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Creating a Push Button fi se t
K
el be createdenby using:
A push button
H can
l i c
l
• The
u ahPush Button tool in the Layout Editor
d The Create icon in the Object Navigator (creates a text item that you can convert to a push
Ab• button)
How to Create a Push Button from the Layout Editor
To create a push button from the Layout Editor, perform the following steps:
1. Invoke the Layout Editor.
2. Set the canvas and block to those where you want the push button to display.
3. Click the Push Button tool.
4. Click the canvas at the position where you want the push button to display.
5. Double-click the push button. The Property Palette appears.
6. Change the name from PUSH_BUTTONXX to the required name.
7. Specify the other properties as required.
Note: Icon image files for iconic buttons must be in GIF or JPEG format for run time, but can be
.ico files to display at design time.
• Label
• Iconic
• Icon Filename
• Default Button
• Mouse Navigate
• Tooltip
a b le
• Tooltip Visual er
Attribute Group an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Properties fora fithe Push
s e tButton
K enappears on the button at run time
el labellithat
• Label:H Text c
l ah Whether the button displays an icon instead of a label
• Iconic:
u
d
Ab• Icon Filename: Name of the file that contains the icon resource (file name only without the
extension, such as list, not list.gif)
• Default Button: Whether this is the default push button for the block, which can be
selected implicitly by pressing [Select] without the need to navigate or use the mouse (The
default push button may be bordered or highlighted in a unique fashion to distinguish it
from other push buttons.)
• Mouse Navigate: Whether Forms navigates to the item when you click it with the mouse
• Tooltip: Help text that should appear in a tool tip beneath the button when the cursor
moves over it
• Tooltip Visual Attribute Group: Named visual attribute to apply to the tool tip at run
time
Calculated Items
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Formula:
– A calculated item value is the result of a horizontal
calculation.
– It involves bind variables.
• Summary:
– A calculated item value is a vertical calculation.
– A summary is performed on values of a single item
a ble
over all rows in a block. er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Calculateda i
fItem e t
K
el can be s
en by:
A calculatedH
item
l i c created
l ah the calculation-specific properties of any existing item that can store a value
• Setting
u
d
Ab• Creating a new item in the Layout Editor and setting its calculation-specific properties
• Using the Create icon in the Object Navigator to create a new item and setting its
calculation-specific properties
Calculation Modes
Calculations can be expressed as a formula or as a summary of all items in a block. Forms
Builder supports the following calculation modes:
• Formula: The calculated item value is the result of a horizontal calculation involving one
or more bind variables, such as form items, global variables, and parameters.
• Summary: The calculated item value is a vertical calculation involving the values of a
single item over all rows within a single block.
Note: A calculated item is read-only. End users cannot insert or modify calculated items. You
should, therefore, generally use display items as calculated items.
• Formula:
– Calculation Mode
– Formula
• Summary:
– Calculation Mode
– Summary Function
– Summarized Block
a b le
er
– Summarized Item
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Setting Item Properties fi for sthe
e t
Calculated Item
l K n
e so far in this lesson, there is no Item Type property value called
eitems lcovered
Unlike the other
H i c
l ahItem. The calculation-specific properties of an item make it a calculated item. Text
Calculated
u
bd and display items both support calculated items.
Aitems
The following properties are specific to calculated items:
• Calculation Mode: The method of computing the calculated item values (None, Formula,
or Summary)
• Formula: A single PL/SQL expression that determines the calculated value of a formula
calculated item; can compute a value or call a subprogram
• Summary Function: The type of summary function (discussed on the following page) to
be performed on the summary calculated item
• Summarized Block: The block over which all rows are summarized in order to assign a
value to the summary calculated item; if not specified, current block is assumed
• Summarized Item: The item whose value is summarized in order to assign a value to the
calculated item; required if the Calculation Mode is Summary
Summary Functions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• AVG
• COUNT
• MAX
• MIN
• STDDEV
a b le
• SUM er
an sf
• VARIANCE - t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Summary Functionsafi e t
l K n s
estandard
You can use Htheefollowing
i c SQL aggregate functions for summary items:
h l
•
u l a
AVG: The average value (arithmetic mean) of the summarized item over all records in the
d
Ab• block
COUNT: Count of all non-null instances of the summarized item over all records in the
block
• MAX/MIN: Maximum/minimum value of the summarized item over all records in the
block
• STDDEV: The standard deviation of the summarized item’s values over all records in the
block
• SUM: Sum of all values of the summarized item over all records in the block
• VARIANCE: The variance (square of the standard deviation) of the summarized item’s
values over all records in the block
Orders
ORDERS
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
NVL((:order_items.unit_price *
:order_items.quantity),0)
Items
a ble
Prod Unit Item er
Item# ID Description Price Quantity Total ansf
1 200 5 1,000 n - t r
oFormula
2 120 4 480a n item
9 ) ha
s
3 50 450 eฺ
4 25 o
3 m G75u id
ฺ c
m ail dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Calculated Item Based a fi on asFormula
e t
K
el litem n on a formula, perform the following steps:
ebased
To create a calculated
H i c
l ah a new item in the Object Navigator or Layout Editor.
1. uCreate
d
Ab2. Open the Property Palette of the item.
3. Set the Calculation Mode property to Formula.
4. Click More for the Formula property and enter the PL/SQL expression to define the
formula.
Note: A formula item cannot be a database item because its value is computed by Forms, not
queried from a database column.
( k a ou
i
f Formulas
Rules for CalculatedaItem e t
K
el lifor n s
ecalculated
When writing
h H formulas c items, observe the following rules:
• The
d u la formula (and any user-written subprogram that calls it) must not invoke any restricted
Ab• The formula (and any user-written subprogram that calls it) cannot execute any DML
built-ins.
statements.
• Do not terminate the PL/SQL expression with a semicolon.
• If the PL/SQL expression involves an assignment, do not enter the complete PL/SQL
statement. Forms Builder assigns the actual assignment code internally.
Example
Suppose you have a formula item called Gross_Comp in the EMPLOYEES block of a form. If
you set the Formula property to:
NVL(:employees.salary,0) * NVL(:employees.commission_pct,0)
Forms Builder internally converts this expression into a complete statement as:
:employees.gross_comp := (NVL(:employees.salary,0) *
NVL(:employees.commission_pct,0));
Orders
ORDERS
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Summarized
item
Items
Item#
Prod
ID Description
Unit
Price Quantity
Item
Total a b le
er
1 200 5 1,000
an sf
2 120 4 480 t
Summary
- r
3 50 9
on
450a n item
4 25 3 h a s75 ฺ
) e
om 2,005uid
Order Total
a ilฺc ent G
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Calculated Item Based a i
f on asSummary
e t
K
el litem n on a summary, perform the following steps:
ebased
To create a calculated
H i c
l ah a new item in the Object Navigator or the Layout Editor.
1. Create
u
d
Ab2. Open the Property Palette of the item.
3. Set the Calculation Mode property to Summary.
4. Select a function from the Summary Function pop-up list.
5. From the Summarized Block pop-up list, select a block over which all rows will be
summarized.
6. From the Summarized Item pop-up list, select an item to be summarized.
Note: A summary item is the calculated item to which you assign a value.
A summarized item is the item whose values are summarized and then assigned to the summary
item.
( k a ou
Rules for Summary a Itemsi
f se t
l K
ecalculated n based on a summary, observe the following rules:
eitems
When creatingH l i c
• The
u l ahsummary item must reside in the same block as the summarized item, or in a control
d
Ab• block whose Single Record property is set to Yes.
The summarized item must reside in a control block, or in a data block whose Query All
Records property or the Precompute Summaries property is set to Yes.
Note: This ensures that records fetched in the block and the summarized value are
consistent. Otherwise, another user may possibly update a record that has not been fetched
yet.
• Set the Data Type property for a summary item to Number, unless the summary function
is Max or Min, in which case the data type must mirror that of its associated summarized
item. For example, a calculated item that displays the most recent (maximum) date in the
HIRE_DATE column must have a data type of Date.
• If the summarized item values are based on a formula, the summarized item must reside in
a block whose Query All Records property is set to Yes.
a ble
er
a n sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Hierarchicala fi TreeseItem t
K enthat displays data in the form of a standard navigator.
el is anlicitem
A hierarchical
H tree
h
HowutolaCreate a Hierarchical Tree Item
bdcreate a hierarchical tree item, do one of the following:
ATo
• In the Layout Editor:
- Click the Hierarchical Tree icon.
- Click and drag the mouse on the canvas to create the hierarchical tree object.
- Set other hierarchical tree–related properties as required.
• In the Object Navigator:
- Create a new item by using the Create icon.
- Open the item’s Property Palette and set the Item Type property to Hierarchical Tree.
- Set other hierarchical tree–related properties as required.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Bean Area Items afi e t
l K s
enwritten in Java that can plug in to any applet or Java application.
A JavaBean H is aecomponent
i c
l
l
The bean
u aharea item enables you to extend Forms functionality by adding a JavaBean to your
bd
Aform.
With JavaBeans, you can interact with the client machine, performing such functions as:
• Obtaining information about the client machine
• Uploading client files to the server machine
• Modifying the user interface on the client
• Checking the spelling of a text item
• Displaying a progress bar, clock, calendar, or color picker with which the operator may be
able to interact and select values
Some of this functionality, such as the calendar, is possible using Forms native functionality.
However, using a JavaBean enables client interaction without generating network traffic.
Although JavaBeans can be used to input data, as in the case of the Calendar JavaBean, the bean
area item itself does not accept user input.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Bean Area a fi se t
K enthe Bean Area tool in the Layout Editor. Click the tool and drag out
el arealiusing
You create aHbean c
onhthe canvas. At first the area will look like an empty rectangle.
an areala
u
bd can also create a bean area from any existing item by changing its item type to Bean Area in
AYou
the Property Palette.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Properties for a i Bean
fthe e tArea
K
el Bean s
n property is Implementation Class. This property is used to
eArea
The most important
H l i c
hfully qualified name of the Java class that the Bean Area item should instantiate.
specifylathe
d u
AIfbthe JavaBean has a visible component, Forms Builder displays the JavaBean within the Bean
Area item in the Layout Editor after the Implementation Class is set. You can set the size and
position of the bean area visually in the Layout Editor, or by changing the X/Y Position, Width,
and Height properties.
Some JavaBeans have no visible component. To avoid the distraction of a large empty rectangle
on the form, you can set the properties so that the bean is displayed as a tiny dot in the corner of
the canvas. Alternatively, you can set its Visible property to No, which ensures that the Bean
Area does not display at run time, although you still see it in the Layout Editor.
Note: With enhanced JavaBean support, it is not necessary to set the Implementation Class at
design time. Instead, you can programmatically register the bean at run time. This is discussed in
the lesson titled “Adding Functionality to Items.”
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
JavaBean at Run Time a fi se t
K en with the JavaBean to perform the functionality that you have
l cancinteract
theeuser
At run time, H i
l
l ah
programmatically
u defined. In the preceding example, there is a button that invokes the
b d
ColorPicker JavaBean. When the operator selects a color from the color picker, it is used to set
Athe background color of the canvas.
This programmatic interaction is discussed in the lesson titled “Adding Functionality to Items.”
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
K
el should n learned that:
ehave
In this lesson,
H you
l i c
l ah items display non-base-table information or derived values
• Display
u
d
Ab• Image items store and display vector or scanned bitmapped images
• Push Buttons initiate an action
• Calculated items base item values on calculations. Calculations can be expressed in one of
the following modes:
- Formula
- Summary
• Hierarchical trees display information in an Object Navigator style display
• Bean Area items enable you to integrate Java components into your application
• You create the above item types by:
- Using the appropriate tool in the Layout Editor
- Clicking Create in the Object Navigator (this creates a text item that you can convert
to a different item type)
- Changing the item type and/or setting appropriate properties on existing items
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Practice 10
1. In the ORDER_ITEMS block of the ORDGXX form, create a display item called
Description. Set the Prompt property to Description and display the prompt centered above
the item. Rearrange the items in the layout so that all are visible.
2. Create an image item called Product_Image in the CONTROL block of the ORDGXX form.
(Use the CONTROL block because you do not want to pick up the Current Record Visual
Attribute Group of the ORDER_ITEMS block, and this is a non-base-table item.) Position
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
this and the other items you create in this practice so that your form looks like the
screenshot.
Note: The image will not display in the image item at this point; you will add code to
populate the image item in Practice 20.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u l a another display item, Image_Description, in the ORDER_ITEMS block. This should
3. Create
d
Ab synchronize with the Description item. Set the Maximum Length property to the same
value as the Description item.
4. In the CONTROL block of the ORDGXX form, create an iconic button called
Product_LOV_Button. Use the list file (do not include the .ico or .gif extension).
Set the Keyboard Navigable property and the Mouse Navigate property to No.
5. To display item total information, set the following properties for the Item_Total item in
the ORDER_ITEMS block:
Set the Item Type to Display Item.
Set the Calculation Mode property to Formula.
Set the Formula property to: nvl(:ORDER_ITEMS.quantity,0) *
nvl(:ORDER_ITEMS.unit_price,0)
Practice 10 (continued)
6. To display the total of the item totals, create a new nondatabase display item in the
CONTROL block.
Set the Position, Size, and Prompt properties according to the screenshot.
Set the Format Mask property to 9G999G990D99.
Set the Justification property to Right.
Set the Number of Items Displayed property to 1.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
a n sf
- t r
on
s an
7. Save the form and click Run Form to run your form to run h it.aPerformฺa query in the
ORDGXX form to ensure that the new items do not cause m ) an error. e you remember to
idDid
switch off the Database Item property for itemsilthat
o
ฺc do not G u
a e n t correspond to columns in the
base table? Also, check that the calculated m tud to the
items function correctly.
8. In the CUSTGXX form, create an e l @gbutton
iconic
i s Ssimilar one created in question 4, in
b h
the CONTROL block. Use the
a f iฺrulist
u s
filet(do not include the .ico or .gif extension).
e
Name the push button
f i ( kAccount_Mgr_Lov_Button,
t o and place it next to Account_Mgr_ID.
9. In the CUSTGXX
l K a form,nscreate
e a bean area in the CONTROL block and name it Colorpicker.
Hehas
This bean e
no visible component on the form, so set it to display as a tiny dot in the
loficthe canvas.
l a h
upper-left corner Ensure that users cannot navigate to the bean area item
u
bd with either the keyboard or mouse. You will not set an implementation class; in Lesson 20,
A you learn how to programmatically instantiate the JavaBean at run time.
10. Save and compile the form. Click Run Form to run your form and test the changes.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
MDI
parent
window
Document
window
a b le
er
n sf
-tra
Canvas
on
a n
a s
m ) h ideฺ
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Windows and Content a i
f Canvases
e t
K
el licen s
What Is a Viewport?
H
l ah is an attribute of a canvas. It is effectively the visible portion of, or view onto, the
A viewport
u
bd
Acanvas.
Content Canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Content Canvas a fi se t
K
el different en types of canvases. A content canvas is the base canvas that
Forms BuilderHoffers
l i c
h entire content pane of the window in which it is displayed. The content canvas is
l
occupies
u athe
bddefault canvas type. Most canvases are content canvases.
Athe
Canvas 1
Window
a b le
Canvas 2 Canvas 3
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Relationship Between a fiWindows
s e t and Content Canvases
K encontent canvas for each window in your application. When you run
eatl leastlicone
You must create
H
a form,la h one content canvas can be displayed in a window at a time, even though more than
only
u
bdcontent canvas can be assigned to the same window at design time.
Aone
At run time, a content canvas always completely fills its window. As the user resizes the
window, Forms resizes the canvas automatically. If the window is too small to show all items on
the canvas, Forms automatically scrolls the canvas to bring the current item into view.
Note: You can assign multiple content canvases to a window; however, only one content canvas
can be displayed in a window at a time.
Default Window
• WINDOW1 is created by
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Default Window a fi se t
K enmodule, Forms Builder creates a new window implicitly. Thus,
ela newlicform
When you create
H
l
each new
u ahform module has one predefined window, which is called WINDOW1. You can delete
d
Aorbrename WINDOW1, or change its attributes.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Window a fi se t
l K
ewindow, e n the following steps:
To create a new
H l i c perform
l ah the Windows node in the Object Navigator.
1. Select
u
d
Ab3.2. Click Create. A new window entry displays, with a default name of WINDOWXX.
If the Property Palette is not already displayed, double-click the window icon to the left of
the new window entry.
4. Set the window properties according to your requirements.
Note: In order for your new window to display, you must specify its name in the Window
property of at least one canvas. To display a console to end users, set the form-level property
Console Window to the window in which you want to display the console. To hide the console,
set the property to <Null>.
1 2
4
a ble
er
an sf
- t r
on
s an 5
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Setting Window Properties fi se t
K en to determine their behavior and appearance. The following are
el for lwindows
You set properties
H
h properties: i c
some oflathe
u
d Position: Specifies the location of the window within the containing window
Ab2.1. X/Y
Title: The title to be displayed; if not specified, uses the name indicated by the window
Name property
3. Horizontal/Vertical Toolbar Canvas: Specifies the toolbar canvas to be displayed
horizontally across the top or vertically to the left of the window; selected from all
horizontal/vertical toolbar canvases assigned to this window
4. Modal: Specifies if window is modal, requiring the user to dismiss the window before any
other user interaction can continue, such as the Question window above
5. Show Horizontal/Vertical Scroll Bar: Whether a horizontal or vertical scroll bar should
display on the window
6. Hide on Exit: Whether Forms hides the window automatically when the end user navigates
to an item in another window (not shown in the slide)
For a description of other properties that affect the behavior of windows, click the property in the
Property Palette and press [F1].
GUI Hints
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
PROPERTIES:
Canvas
CV_ORDER
Window:
WIN_ORDERS
a b le
Canvas er
CV_INVENTORY an sf
- t r
Window: on
WIN_INVENTORY s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Displaying a Form Module fi soneMultiple
t Layouts
l K
e than n
e content canvas in your Forms application. However, remember that
You can haveHmore
l i cone
h canvas can be displayed in a window at one time. To display more than one
l
only one
u acontent
bd canvas at the same time, you can assign each content canvas to a different window.
Acontent
Now you can display the form module on multiple layouts or surfaces.
• Implicitly:
2
• Explicitly:
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a New Contenta fi Canvas
s e t
K en can be implicit or explicit.
ofea lcontent
The creationH i ccanvas
l
l ahCreating a Content Canvas
Implicitly
u
bd are two ways of implicitly creating a new content canvas:
AThere
1. Layout Wizard: When you use the Layout Wizard to arrange data block items on a
canvas, the wizard enables you to select a new canvas on its Canvas page. In this case, the
wizard creates a new canvas with a default name of CANVASXX.
2. Layout Editor: When there are no canvases in a form module and you invoke the Layout
Editor, Forms Builder creates a default canvas on which you can place items.
Explicitly Creating a Content Canvas
You can create a new content canvas explicitly by using the Create icon in the Object Navigator.
Note: Double-clicking the icon for a canvas in the Object Navigator invokes the Layout Editor
instead of the Property Palette.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Viewport
X/Y Position
on Canvas
a b le
er
an sf
- t r
on
s an
) ha deฺ
o m GuCanvas i
c
ailฺ dent
Viewport
m
g Stu
e l @ is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Content Canvas a fi Properties
s e t
K en
el ltoicdetermine
You can set properties
H how the canvas is to be displayed. Several properties in the
h
lagroup are depicted in the slide: Width, Height, and Viewport X/Y Position on Canvas.
Physical
b
Forda
ucanvas to display at run time, its Window property must also be specified and its Visible
Aproperty must be set to Yes.
In the General group, you can choose the Canvas Type. (This lesson explains the content canvas.
For information about other canvas types, refer to the lesson titled “Working with Other Canvas
Types.”)
In the Functional group, you can set Raise on Entry to affect whether the canvas is always
brought to the front of the window when the user navigates to an item on the canvas. You use
this property when the canvas is displayed in the same window with other canvases. Forms
always ensures that the current item is visible. Even if Raise on Entry is set to No, Forms will
bring the canvas to the front of the window if the user navigates to an item on the canvas that is
hidden behind other canvases.
Performance Tip: To reduce the time that is needed to display the initial screen, keep the
number of items initially displayed to a minimum. You can hide elements, such as canvases, that
are not immediately required. To do this, set the canvas Raise on Entry property to Yes, and set
Visible to No.
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 11: Overview a fi se t
l K
esession, enwill customize windows in your form modules. You will resize the
In this practice
H l i c
you
windows
u l ahto make them more suitable for presenting canvas contents. You will also create a new
bd to display the contents of the INVENTORIES block.
Awindow
• Change the size and position of the window in the CUSTOMERS form. Change its name
and title. Save and run the form.
• Modify the name and title of the window in the ORDERS form.
• Create a new window in the ORDERS form. Make sure the contents of the INVENTORIES
block display in this window. Save and run the form.
Note: For solutions to this practice, see Practice 11 in Appendix A, “Practice Solutions.”
Practice 11
1. Modify the window in the CUSTGXX form. Change the name of the window to
WIN_CUSTOMER, and change its title to Customer Information. Check that the size and
position are suitable.
2. Save, compile, and run the form to test the changes.
3. Modify the window in the ORDGXX form. Ensure that the window is called WIN_ORDER.
Also change its title to Orders and Items. Check that the size and position are suitable.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
4. In the ORDGXX form, create a new window called WIN_INVENTORY suitable for
displaying the CV_INVENTORY canvas. Use the rulers in the Layout Editor to help you
plan the height and width of the window. Set the window title to Stock Levels. Place the
new window in a suitable position relative to WIN_ORDER. Ensure that the window does
not display when the user navigates to an item on a different window.
5. Associate the CV_INVENTORY canvas with the WIN_INVENTORY window. Compile the
form. Click Run Form to run the form. Ensure that the INVENTORIES block is displayed
in WIN_INVENTORY when you navigate to this block. Also make sure that the
WIN_INVENTORY window is hidden when you navigate to one of the other blocks.
6. Save the form. r a ble
sfe
r a n
on -t
a n
a s
m ) h ideฺ
i l ฺ co t Gu
g ma tuden
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Stacked Vertical
canvas toolbar
a ble
er
an sf
Tab x y z
- t r
on
Tab
s an
page
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Overview of CanvasaTypes fi se t
K
elcontent en Forms Builder provides three other types of canvases:
In addition toHthe
l i ccanvas,
l ah canvas
• Stacked
u
d
Ab• Toolbar canvas
• Tab canvas
When you create a canvas, you specify its type by setting the Canvas Type property. The type
determines how the canvas is displayed in the window to which it is assigned.
Stacked Canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Stacked Canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
2
1
3
a ble
4 er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
5
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Stacked Canvas (continued) a fi se t
K en on the content canvas. You can see the following elements
el is displayed
The stacked H canvas
l i c
depicted
u l ainh the slide:
d
Ab1.2. Content canvas
Stacked canvas
3. Viewport X/Y position
4. Viewport height
5. Viewport width
Uses and Benefits of Stacked Canvases
With stacked canvases, you can achieve the following:
• Scrolling views as generated by Oracle Designer
• Creating an overlay effect within a single window
• Displaying headers with constant information, such as company name
• Creating a cascading or a revealing effect within a single window
• Displaying additional information
• Displaying information conditionally
• Displaying context-sensitive help
• Hiding information
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Creating a Stacked Canvas fi se t
K
ea lstacked en in either of the following:
You can create
H l i ccanvas
l ah Editor
• Layout
u
d
Ab• Object Navigator
How to Create a Stacked Canvas in the Layout Editor
To create a stacked canvas in the Layout Editor, perform the following steps:
1. In the Object Navigator, double-click the object icon for the content canvas on which you
want to create a stacked canvas.
The Layout Editor is displayed.
2. Click the Stacked Canvas tool in the toolbar.
3. Click and drag in the canvas where you want to position the stacked canvas.
4. Open the Property Palette of the stacked canvas. Set the canvas properties according to
your requirements (described later in this lesson).
3. If the Property Palette is not already displayed, select the new canvas entry and then select
Tools > Property Palette.
4. Set the Canvas Type property to Stacked. Additionally, set the properties that are described
later in this lesson according to your requirements.
5. Ensure that the stacked canvas is below the content canvas in the Object Navigator.
Note: To convert an existing content canvas to a stacked canvas, change its Canvas Type
property value from Content to Stacked.
In order for the stacked canvas to display properly at run time, make sure that its position in the
stacking order places it in front of the content canvas assigned to the same window. The stacking e
order of canvases is defined by the sequence in which they appear in the Object Navigator. rab
l
sf e
Displaying Stacked Canvases in the Layout Editor
tr a n
o
You can display a stacked canvas as it sits over the content canvas in the Layoutn -Editor. You can
check the display position of stacked canvases by doing the following: s an
ha deฺCanvases dialog box
• Select View > Stacked Views in the Layout Editor. The )Stacked/Tab
is displayed, with a list of all the stacked canvases o m G
assigned to u i same window as the
the
c
current content canvas.
m ailฺ dent
• Select the stacked canvases you want@ tog
display
S tuthe Layout Editor.
in
e l
his that was previously selected.
ruabstackedtcanvas
Note: Press [Ctrl] and click to clear
k a fiฺ use
a fi ( se to
e l K cen
h H li
d u la
A b
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Setting Stacked Canvasa fi Properties
s e t
K
elproperties enthat you can set to affect the appearance and behavior of stacked
There are several
H l i c
l
canvases:
u ah
d Raise on Entry: Controls how Forms displays the canvas when the user or the application
Ab• navigates to an item on the canvas
• Viewport X/Y Position: Specifies the point at which the upper-left corner of the stacked
canvas is located in relation to the content canvas
• Viewport Width/Height: Determines the size of the stacked canvas displayed at run time
• Visible: Indicates whether the stacked canvas is initially displayed or visible; set to Yes or
No to show or hide the stacked canvas
• Window: Specifies the window in which the canvas will be displayed
• Show Horizontal/Vertical Scroll Bar: Specifies whether scrollbars display with the
canvas
Toolbar Canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
MDI Toolbar
Run-time parameter: Window property:
otherparams=useSDI=no
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Form property:
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
MDI Toolbar a fi se t
K
ethel toolbar etonindividual windows, or to the form itself. Attaching a toolbar to a
You can attach
H l i c
l ah an MDI toolbar, so that you do not need to create more than one toolbar for a
form provides
u
bd application that uses multiple windows. If you display a toolbar in the MDI window, the
AForms
same toolbar will not be duplicated in the individual windows of the form.
Whether an MDI toolbar is displayed is determined by a combination of Form properties and the
useSDI run-time parameter, which you set as part of otherparams:
• Canvas properties:
– Canvas Type
– Window
– Width or Height
• Window properties:
– Horizontal Toolbar
Canvas
a ble
er
– Vertical Toolbar
an sf
Canvas - t r
on
• Form Module properties:
s an
– Form Horizontal Toolbar Canvas) ha eฺ
m i d
– Form Vertical Toolbar Canvas i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
a
Setting Toolbar Properties i
f se t
K
eal toolbar n you can set its properties as well as the properties of the
ecanvas,
After you create
H l i c
l ahwindow or form module:
associated
u
d
Ab• Canvas Properties:
- Canvas Type: Either Horizontal or Vertical Toolbar
- Window: Specifies in which window the toolbar displays
- Width/Height: Size of canvas. The width of a horizontal toolbar is set to the width of
the window (for example, content canvas). Likewise, the height of a vertical toolbar
is set to the height of the window.
• Window Property:
- Horizontal/Vertical Toolbar Canvas: Identifies the horizontal/vertical toolbar to be
displayed in this window
• Form Module Property:
- Form Horizontal/Vertical Toolbar Canvas: Identifies the horizontal/vertical toolbar to
be displayed in the MDI window (when the useSDI run-time parameter is set to No)
Tab Canvas
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
• Enables you to organize and display related
an sf
information on separate tabs - t r
n on
• Consists of one or more tab pages s a
a ฺ
• Provides easy access to data m) h uide
i l ฺ co t G
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Tab Canvas a i
f se t
l K
eCanvas? en
What Is a Tab
H l i c
l ah is a special type of canvas that enables you to organize and display related
A tabucanvas
bd
Ainformation on separate tabs. Like stacked canvases, tab canvases are displayed on top of a
content canvas.
What Is a Tab Page?
A tab page is a subobject of a tab canvas. Each tab canvas is made up of one or more tab pages.
A tab page displays a subset of the information in the entire tab canvas. Each tab page has a
labeled tab that end users can click to access information on the page.
Each tab page occupies an equal amount of space on the tab canvas.
Uses and Benefits of Tab Canvases
You can use tab canvases to:
• Create an overlay effect within a single window
• Display large amounts of information on a single canvas
• Hide information
• Easily access information by clicking the tab
• Create in:
– Object Navigator
– Layout Editor
• Define tab pages.
• Place items on tab pages.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Tab Canvas a fi se t
K
el ltab n you must:
ecanvas,
To create a functional
H i c
l ah an empty tab canvas in either of the following:
• Create
u
d
Ab -- LayoutObject Navigator
Editor
• Define one or more tab pages for the tab canvas.
• Place items on the tab pages.
Note: Although it is possible to get rid of a content canvas after creating a tab canvas, it is still
highly recommended that there be at least one content canvas for each window in your Forms
application.
a ble
er
a nsf
- t r
on
s an
Create new Canvas Set Canvas Type ) ha dTab
Create eฺ Pages
m i
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Creating a Tab Canvas a i
f in the e t Navigator
Object
K
l incthe
ecanvas s
enObject Navigator, perform the following steps:
To create a tab
H i
l
l ah the Canvases node in the Object Navigator.
1. Select
u
d
Ab2. Click the Create icon.
A new canvas entry is displayed.
3. If the Property Palette is not already displayed, select the new canvas entry and select Tools
> Property Palette.
4. Set the Canvas Type property to Tab. Additionally, set the canvas properties according to
your requirements (described later in the lesson).
5. Expand the canvas node in the Object Navigator.
The Tab Pages node is displayed.
6. Click the Create icon.
A tab page displays in the Object Navigator, with a default name of PAGEXX. The
Property Palette takes on its context.
7. Set the tab page properties according to your requirements (described later in the lesson).
8. Create additional tab pages by repeating steps 6 and 7.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Tab Canvas a fi in the
s e t
Layout Editor
l K n
e Layout Editor, perform the following steps:
ecanvas linicthe
To create a tab
H
h Object Navigator, double-click the object icon for the content canvas on which you
1. Inlathe
d u
Ab want to create a tab canvas.
The Layout Editor is displayed.
2. Click the Tab Canvas tool in the toolbar.
3. Click and drag in the canvas where you want to position the tab canvas.
Forms Builder creates a tab canvas with two tab pages by default.
4. Open the Property Palette of the tab canvas. Set the canvas properties according to your
requirements (described later in the lesson).
5. Create additional tab pages, if needed, in the Object Navigator.
6. Set the tab page properties according to your requirements (described later in the lesson).
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
a ilฺ ent 2
g m tud
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Setting Tab Canvas,aTab i
f Page, e tand Item Properties
K
eal tab canvas s
enand its tab pages, you must set some properties for both of these
After you create
H l i c
h items on a tab page by setting the necessary item properties.
objects.laPlace
u
d Canvas Properties:
Ab• Tab 1. Viewport X/Y Position: Specifies the point at which the upper-left corner of the tab
page is located in relation to the content canvas
2. Viewport Width/Height: Defines the size of tab canvas
3. Corner Style: Specifies the shape of labeled tabs (Chamfered, Square, or Rounded)
- Tab Attachment Edge: Where tabs are attached (Top, Bottom, Left, Right, Start, or
End)
- Width Style: Whether the width of the tab will vary with the length of the label
- Active Style: Whether label displays as bold when tab page is active
• Tab Page Property: Label specifies the label to be displayed on the tab page’s tab
• Item Properties:
- Canvas: The tab canvas on which the item will be displayed
- Tab Page: The tab page on which the item will be displayed
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Placing Items on a Tab a fi Page s e t
K
eal tab canvasenand related tab pages, you place items on the tab pages that the end
After you create
H l i c
l
users can
u ahinteract with at run time:
d Open the Property Palette of the item.
Ab•• Set the item’s Canvas and Tab Page properties of the item to the desired tab canvas and tab
page.
Note: Display the tab canvas as it sits on top of the content canvas, by selecting View > Stacked
View in the Layout Editor.
Performance Tip: The time taken to load and initialize a TAB canvas at run time is related to
all objects on the canvas and not just to those initially visible.
Summary
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Practice 12: Overview a fi se t
l K
esession, enwill create different types of canvases: stacked canvas, toolbar
In this practice
H
h tab canvas. l i c
you
canvas,laand
d u
Ab• Create a horizontal toolbar canvas in the ORDERS form. Create new buttons in the
CONTROL block, and place them on the horizontal toolbar. Save and run the form.
• Create a stacked canvas in the ORDERS form to add some help text. Position the canvas in
the center of the window. Create a button in the CONTROL block. This button will be used
later to display the stacked canvas. Add help text on the stacked canvas. Save and run the
form.
• Create a tab canvas in the CUSTOMERS form. Create three tab pages on this canvas, and
make sure that each tab page displays the appropriate information. Save and run the form.
Note: For solutions to this practice, see Practice 12 in Appendix A, “Practice Solutions.”
Notice that the toolbar now uses part of the window space. Adjust the window size
accordingly.
3. Create three push buttons in the CONTROL block, as shown in the following table, and
place them on the Toolbar canvas. Resize the Toolbar if needed.
Suggested positions for the push buttons are shown in the illustration.
Push Button Name Details
Stock_Button Label: Stock
Mouse Navigate: No
Keyboard Navigable: No
Canvas: Toolbar
a ble
Height: 16
er
Background Color: white
an sf
Show_Help_Button Label: Show Help
- t r
Mouse Navigate: No on
Keyboard Navigable: No
s an
Canvas: Toolbar
Height: 16 ) ha deฺ
c
Background Color: whiteo m Gui
Exit_Button Label: Exit
m ailฺ dent
@g is Stu
Mouse Navigate: No
l
Keyboard Navigable: No
e
f i rub se th
Canvas: Toolbar
ฺ
Height: 16
( k a ou
a i
f se t Background Color: white
K
el licen
H
u l ah
A bd
a b le
er
an sf
- t r
n on
5. Position the view of the stacked canvas so that it appears in thescenter a of WIN_ORDER.
Ensure that it will not obscure the first enterable item. ) h a eฺ
Do this by planning the upper-left position of the c m
o in the
view i d
u Editor, while showing
Layout
CV_ORDER. Define the Viewport X and Viewport i l ฺ t G
a den in the Property Palette. You
Y Positions
can resize the view in the Layout Editor.
m
g Stu
e l @
6. Organize CV_HELP so that it isbthe last canvas is in sequence.
ฺ r u t h
k a fi (This
Do this in the Object Navigator.
u seensures the correct stacking order at run time.)
( to Run Form to run the form and test the changes. Note that
K a iis initially
7. Save and compilefthe
the stacked lcanvas
form. Click
n s e displayed until it obscures the current item in the form.
8. SwitchH e e
lic property of CV_HELP, and then create a push button in the
off the Visible
l a h block to hide the Help information when it is no longer needed. You will add
b duCONTROL
the code later. Display this push button on the CV_HELP canvas.
A
Push Button Name Details
Hide_Help_Button Label: Hide Help
Mouse Navigate: No
Keyboard Navigable: Yes
Canvas: CV_HELP
Width, Height: 65, 16
X, Y Positions: 180, 200
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
12. Reorder the items according to the tab page sequence. Ensure that the user moves smoothly
from one tab page to another when tabbing through items. Set the Next Navigation Item ble
and Previous Navigation Item properties to make it impossible to tab to the Customer_Id
s f era
item after you tab out of that item initially.
- t r an
Note: Because Customer_Id is now the only item on the CV_CUSTOMER
nonof making
either its Enabled or Keyboard Navigable properties to No has theaeffect
canvas, setting
the
item not visible. This is because Forms must be able to navigate
s
ha todan ฺitem on a canvas in
) i e
order to display that canvas’ items.
l ฺ c om t Gu
13. Save and compile the form. Click Run Form a toirun your
enform and test the changes.
g m tud
be l@ is S
f i ฺ ru se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Introduction to Triggers
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Trigger: Overview
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Queries PL/SQL
Validation
Navigation
Event Fire
Interaction PL/SQL
Internal event
Errors/Messages a ble
er
Others
PL/SQL
an sf
- t r
on
Trigger types
s an
) ha deฺ
Which trigger would you use to perform o mcomplex u i calculations
c G
after a user enters data into an item?
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Trigger: Overview afi e t
K
el lunit s
n is executed (fired) due to an event. As explained earlier, Forms
ethat
A trigger is aH
program i c
h you to build powerful facilities into applications without writing a single line of
Builderla
enables
u
bd However, you can use triggers to add or modify form functionality in a procedural way. As
Acode.
a result, you can define the detailed processes of your application.
You write Forms Builder triggers in PL/SQL. Every trigger that you define is associated with a
specific event. Forms Builder defines a vast range of events for which you can fire a trigger.
These events include the following:
• Query-related events
• Data entry and validation
• Logical or physical navigation
• Operator interaction with items in the form
• Internal events in the form
• Errors and messages
Events cause the activation, or firing, of certain trigger types. The next page shows the categories
of triggers and when they fire. By understanding when triggers fire, you can code them
appropriately. For example, to perform complex calculations after a user enters data into an item,
you can use a When-Validate-Item trigger.
Trigger Categories
Triggers may be categorized based on their functions:
Category Fires Examples
Block In response to events When-Create-Record
processing related to record When-Clear-Block
management in a block When-Database-Record
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
When-Remove-Record
Interface In response to events that Key-[all]
event occur in the form interface When-Button-Pressed
When-[Checkbox | List | Radio]-Changed
When-Image-[Activated | Pressed]
When-Timer-Expired
When-Window-[Activated | Deactivated |
Closed | Resized]
Master-detail To enforce coordination On-Check-Delete-Master
between records in a detail On-Clear-Details
block and the master record On-Populate-Details
a ble
in a master block er
Message- In response to default On-Error an sf
- t r
handling messaging events On-Message
on
Navigational
an
In response to navigational Pre-[Form | Block | Record | Text-Item]
s
events
ha deฺ
Post-[Form | Block | Record | Text-Item]
)
When-New-[Form | Block | Record | Item]-
c o
Instance
m Gui
Query-time Just before and just after
m ailฺ dent
Pre-Query
the operator or the
e l @g is Stu
Post-Query
rub se th
application executes a
f i ฺ
query in a block
a ou
Transactional ( k
During the commit process On-Commit, On-Delete, On-Insert, On-
i
f se t
K a Update
Validation el
H l c en
When Forms validates data When-Validate-[Item | Record]
i
u l ah after the user enters data
Category Description
When-Event Point at which Forms default processing may be augmented with
additional tasks or operations
On-Event Point at which Forms default processing may be replaced
Pre-Event Point just prior to the occurrence of either a When-event or an On-event;
use to prepare objects or data for the upcoming event
Post-Event Point just following the occurrence of either a When-event or an On-
event; use to validate or perform auditing tasks based on the prior event
Key Triggers Fires when the operator presses a specific key or key-sequence.
Code
Type
Scope
a ble
er
an sf
- t r
on
What level?
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Trigger Components a fi se t
K en to consider when you design a trigger in Forms Builder:
l components
emain
There are three
H l i c
l ah type: Defines the specific event that causes the trigger to fire
• Trigger
u
d
Ab•• Trigger code: The body of PL/SQL that defines the actions of the trigger
Trigger scope: The level in a form module at which the trigger is defined—determining
the scope of events that is detected by the trigger
Trigger Type
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Pre-
What event?
• Post-
• When- Code
• On- Type
• Key- Scope
• User-named
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Trigger Type a fi se t
l K
edetermines enwhich type of event fires it. There are more than 100 built-in
The trigger type
H l i c
h identified by a specific name. Triggers are mostly fired by events within a form
l
triggers,
u aeach
bd Menu modules can initiate an event in a form, but the form module owns the trigger that
Amodule.
fires.
The name of a trigger identifies its type. All built-in trigger types are associated with an event,
and their names always contain a hyphen (-). For example:
• When-Validate-Item fires when Forms validates an item.
• Pre-Query fires before Forms issues a query for a block.
Note: Database events that occur on behalf of a form can fire certain triggers, but these database
triggers are different from Forms Builder triggers.
Forms Builder supports user-named triggers as well as the standard built-in triggers. A
user-named trigger is one that is named by the designer. These triggers fire only if called by
another trigger or program unit using built-in code features.
Trigger Type
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
Forms Builder Trigger c o m Gui
Types
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Trigger Type (continued) a fi se t
K en (before the first hyphen) follows a standard convention; this helps
ofeal trigger
The first partH i cname
l
u ah
you to lunderstand the general nature of the trigger type, and plan the types to use.
d
AbTrigger Prefix Description
Key- Fires in place of the standard action of a function key
On- Fires in place of standard processing (used to replace or bypass a
process)
Pre- Fires just before the action named in the trigger type (for
example, before a query is executed)
Post- Fires just after the action named in the trigger type (for example,
after a query is executed)
When- Fires in addition to standard processing (used to augment
functionality)
Trigger Code
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
What action?
Code • Statements
• PL/SQL
Type
• User
Scope subprograms r a ble
n s fe
• Built-in - t r a
non
subprograms
a
a s
m ) h ideฺ
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ is AllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Trigger Code a i
f se t
K
l defines en the actions for the trigger to perform when it is fired. Write this
theetrigger
The code of H i c
l
anhanonymous PL/SQL block by using the PL/SQL Editor. You need to enter the
code asla
u
bd . . END structure in your trigger text only if you start your block with a DECLARE
ABEGIN.
statement or if you need to code subblocks.
Statements that you write in a trigger can be constructed as follows:
• Standard PL/SQL constructs (assignments, control statements, and so on)
• SQL statements that are legal in a PL/SQL block; these are passed to the server
• Calls to user-named subprograms (procedures and functions) in the form, a library, or the
database
• Calls to built-in subprograms and package subprograms
Although you can include SQL statements in a trigger, keep in mind the following rules:
• INSERT, UPDATE, and DELETE statements can be placed in transactional triggers. These
triggers fire during the commit process.
• Transaction control statements (COMMIT, ROLLBACK, and SAVEPOINT) should not be
included directly as SQL trigger statements. These actions are carried out automatically by
Forms as a result of either commands or built-in procedures that you issue. If included in
triggers, these commands are redirected to be handled by Forms. For example, COMMIT
issues a COMMIT_FORM.
Trigger Scope
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Code Levels
Type • Form
• Block
Scope
• Item
a ble
er
an sf
- t r
on
What level?
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Trigger Scope a fi se t
K en
l iscdetermined
ae
The scope ofH trigger i by its position in the form object hierarchy—that is, the type
h l
d u launder which you create the trigger. There are three possible levels:
of object
Ab form. level: The trigger belongs to the form and can fire due to events across the entire
• Form
• Block level: The trigger belongs to a block and can fire only when this block is the current
block.
• Item level: The trigger belongs to an individual item and can fire only when this item is the
current item.
Some triggers cannot be defined below a certain level. For example, Post-Query triggers cannot
be defined at item level because they fire due to a global or restricted query on a block.
By default, only the trigger that is most specific to the current location of the cursor fires.
Trigger Scope
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Order
Event
Date Event
a b le
er
an sf
- t r
on
Event
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Trigger Scope (continued)fi se t
K
el linicthe endiagram in the slide:
Consider theHexample
• When
u l ah the cursor is in the Order_Date item, a message fires the On-Message trigger of
d
Ab the Order_Date item because this is more specific than the other triggers of this type.
• When the cursor is elsewhere in the ORDERS block, a message causes the
block-level On-Message trigger to fire because its scope is more specific than the form-
level trigger. (You are outside the scope of the item-level trigger.)
• When the cursor is in the ITEMS block, a message causes the form-level
On-Message trigger to fire because the cursor is outside the scope of the other two
On-Message triggers.
Note: The On-Message trigger fires whenever Forms displays a message. It is recommended that
you code On-Message triggers only at the form level.
EH = Before
Block On-Message On-Error
level
2 Event 4
EH = After EH = Override
a b le
er
Item On-Message
a n sf
level - t r
3 on
Event s an
EH = After ) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Execution Hierarchyafi e t
K s
en is more than one trigger of the same type, Forms normally fires the
el whenlicthere
As already stated,
H
ah specific to the cursor location. You can alter the firing sequence of a trigger by
triggerlmost
u
bd the Execution Hierarchy trigger property.
Asetting
Execution Hierarchy (EH) is a trigger property that specifies how the current trigger code should
execute if there is a trigger with the same name defined at a higher level in the object hierarchy.
Setting EH for form-level triggers has no effect because there is no higher-level trigger.
Settings for Execution Hierarchy are the following:
• Override: Only the trigger that is most specific to the cursor location fires. This is the
default.
• After: The trigger fires after firing the same trigger, if any, at the next highest level.
• Before: The trigger fires before firing the same trigger, if any, at the next highest level.
In the cases of Before and After, you can fire more than one trigger of the same type due to a
single event. However, you must define each trigger at a different level.
Note: Broken lines indicate the analysis path before firing. EH stands for Execution Hierarchy.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Producing Triggers
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Creating a Trigger
Step one:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Form level
Block level
Item level a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Creating a Trigger afi e t
K
el Trigger n s
eScope
Step One: Select
H l i c
l ah Navigator, select the Triggers node of the form, block, or item that will own the
In theuObject
bd Alternatively, you can select an item in the Layout Editor if you are defining an item
Atrigger.
level trigger.
A mistake often made by inexperienced Forms developers is to define a trigger at the wrong
scope. For example, if you want a message to display when the cursor is placed on an item, you
should code a When-New-Item-Instance trigger at the item level for that item. If you mistakenly
put the trigger at the block or form level, the trigger will fire whenever the operator navigates to
any item in the block or form.
Creating a Trigger
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Step two:
Invoke the
Trigger LOV.
a b le
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Creating a Trigger (continued)
K en LOV
el theliTrigger
Step Two: Invoke
H c
l
Afterutheahtrigger scope is selected, there are several ways to invoke the Trigger LOV:
d
Ab• Smart Triggers: Right-click to display the pop-up menu. Select Smart Triggers. This
invokes the Smart Triggers LOV displaying a list of common triggers for the selected
object. If you do not see the desired trigger, select Other to display the Trigger LOV with a
full list of triggers.
• Create: If you are in the Object Navigator with a Triggers node highlighted, select Edit >
Create from the menu, or click Create in the toolbar. This invokes the Trigger LOV.
• PL/SQL Editor: Right-click to display the pop-up menu. Select PL/SQL Editor.
- If there is no trigger defined for the object, this invokes the Trigger LOV.
- If there are already triggers defined for the object, the name and code of the first one
appear in the editor. To define an additional trigger for the item, click Create in the
Object Navigator toolbar to invoke the Trigger LOV.
After the Trigger LOV is invoked, select the trigger type.
Creating a Trigger
Step three:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
Source er
pane
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Creating a Trigger (continued)
K
elthe PL/SQL en Editor to Define the Trigger Code
Step Three:H Use
l i c
l ah type and scope are now set in the PL/SQL Editor. You can enter the code for the
The trigger
u
bd in the source pane of the editor.
Atrigger
In Forms Builder, the PL/SQL Editor has the following specific trigger components:
• Name: Trigger name; pop-up list enables you to switch to a different trigger
• Type: Set to Trigger (The other types are Program Unit and Menu Item Code, but these are
not valid for triggers.)
• Object: Enables you to set the scope to either Form Level, or a specific block
• Item: Enables you to change between specific items (at item level) to access other triggers.
The Item trigger component is not labeled.
• Source pane: Where trigger code is entered or modified
• Toolbar: Buttons to compile, revert, undo, redo, indent, or outdent the code
Step Four: Compile
Click the Compile icon in the PL/SQL Editor to compile the trigger. This displays immediate
feedback in the form of compilation error messages, which you can correct. If the trigger
compiles correctly, a message displays in the lower-right corner of the editor.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
Setting Trigger Properties
l K
efollowing n properties to affect the behavior of triggers:
etrigger
You can set the
H l i c
l ah
• General
u
d - Name: Specifies the internal name of the trigger
Ab• Functional
- Fire in Enter Query Mode: Specify whether the trigger can fire when an event
occurs in Enter Query as well as Normal mode.
- Execution Hierarchy: Use to change the default order of trigger firing when
multiple triggers of the same name are defined at different levels.
• Help (these properties valid only for Key triggers)
- Display in “Keyboard Help”: Specify whether you want the name or description to
appear in the Show Keys window.
- “Keyboard Help” Text: Description to replace the default key description.
a ble
er
an sf
- t r
on
s an
Split view
) ha deฺ
c o m Gui
Split bars
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
PL/SQL Editor: Features fi se t
K
el provides enthe following features:
The PL/SQLHEditor
l i c
l ah formatting and coloring of PL/SQL code
• Automatic
u
d Automatic indenting and color syntax highlighting
Ab•• Drag-and-drop text manipulation
• Unlimited undo/redo
• Multiple split views
You can create up to four separate views of the current program unit in the PL/SQL Editor by
using split bars. Place the cursor over the split bar; it changes to a double-headed arrow. Click
and drag the split bar to the desired location. To remove the split, drag it back to its original
location.
Trigger Components of the PL/SQL Editor
1. Type: Set to Trigger
2. Object: Enables you to set scope to Form Level or a specified block
3. Item: Enables you to switch between items (if item-level trigger) to access other triggers
4. Name: Trigger name; enables you to switch to another existing trigger
5. Source Pane: Where trigger code is entered or modified
a b le
er
Syntax
an sf
palette - t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
PL/SQL Editor: Features fi (continued)
s e t
l K
eEnables ento display and copy the constructs of PL/SQL language elements
Syntax Palette:
H l i cyou
l ah packages into an editor. To invoke the Syntax Palette, select Tools > Syntax Palette
and built-in
u
bd the menu system.
Afrom
Global Search and Replace: Enables you to search for text across multiple program units
without opening individual instances of the Program Unit Editor. You can replace every
occurrence of the search string or selected occurrences only.
Invoke the Find and Replace in Program Units dialog box by selecting Edit > Find and Replace
PL/SQL from the menu system.
Things to Remember About the PL/SQL Editor
• New or changed text in triggers remains uncompiled until you click Compile.
• Compiling triggers that contain SQL require connection to the database.
• All uncompiled triggers are compiled when the form module is compiled.
• The Block and Item pop-up lists do not change the current trigger scope. They enable you
to switch to another trigger.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Database Trigger Editor a fi se t
K en within the Database Trigger Editor enables developers to create
el oflicitems
The logical grouping
H
row and l h
astatement triggers easily. An error message box displays an error when you try to
b d u
retrieve, store, or drop an invalid trigger. To create a database trigger by using the Database
ATrigger Editor, perform the following steps:
1. In the Object Navigator, expand the Database Objects node to display the schema nodes.
2. Expand a schema node to display the database objects.
3. Expand the Tables node to display the schema’s database tables.
4. Select and expand the desired table.
5. Select the Triggers node and choose Edit > Create, or click Create on the toolbar. The
Database Trigger Editor appears.
6. In the Database Trigger Editor, click New.
7. Define and save the desired program units.
a ble
er
an sf
- t r
on
s an
) ha deฺ
END;
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Writing Trigger Code a fi se t
K en trigger is a PL/SQL block that consists of three sections:
The code textHofeal Forms i cBuilder
• Ala h
declaration
l
section for variables, constants, and exceptions (optional)
d u
Ab• An exception handlers
• An executable statements section (required)
section (optional)
If your trigger code does not require defined variables, you do not need to include the BEGIN
and END keywords; they are added implicitly.
defined in a package.
a b le
er
an sf
- t r
on
• Forms Builder variables:
s an
– Are not formally declared in PL/SQL
) ha deฺ
– Need a colon (:) prefix in reference c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Using Variables in Triggersfi se t
l K
esubprograms, enForms Builder generally accepts two types of variables for storing
In triggers and
H l i c
values:lah
du
Ab• PL/SQL variables: These must be declared in a DECLARE section, and remain available
until the end of the declaring block. They are not prefixed by a colon. If declared in a
PL/SQL package, a variable is accessible across all triggers that access this package.
• Forms Builder variables: These are the variable types maintained by the Forms Builder.
These are seen by PL/SQL as external variables, and require a colon (:) prefix to
distinguish them from PL/SQL objects (except when the name is passed as a character
string to a subprogram). Forms Builder variables are not formally declared in a DECLARE
section, and can exist outside the scope of a PL/SQL block.
Variable
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Forms Builder Variablesa i
f se t
K
el licen
Formla h H
Builder Scope Use
d u
AbVariable Type
Item (text, list, check Current form and attached Presentation and interaction
box, and so on) menu with user
Global variable All modules in current Sessionwide storage of
session character data
System variable Current form and attached Form status and control
menu Note: The contents of system
variables are in uppercase.
Parameter Current module Passing values in and out of
module
which prevents ambiguity when items of the same name exist in different blocks. This is
also more efficient than the item name alone:
:BLOCK3.product_id := :BLOCK2.product_id;
2. References to global variables must be prefixed by the word global. They may be created
as the result of an assignment:
:GLOBAL.customer_id := :BLOCK1.id;
3. References to system variables must be prefixed by the word System, and the contents must
be in uppercase (’NORMAL’, not ’normal’):
IF :SYSTEM.MODE = ’NORMAL’ THEN
ok_to_leave_block := TRUE;
a b le
END IF;
er
4. Parameters defined at design-time have the prefix parameter:
an sf
- t r
on
IF :PARAMETER.starting_point = 2 THEN
GO_BLOCK(’BLOCK2’); -- built-in procedure
s an
ha deฺ
END IF;
Initializing Global Variables with Default Value )
m Gui
c o
You can use the DEFAULT_VALUE built-in to assign a ilฺa value
e
tot a global variable. Forms Builder
n
creates the global variable if it does not exist. g m
If the value
t udof the indicated variable is not null,
DEFAULT_VALUE does nothing. The following l @
e hiexample s S creates a global variable named
u b t
k a f r uTURKEY:
country and initializes it with theiฺvalue
se
(
fi se to
Default_Value(’TURKEY’,’GLOBAL.country’);
Removing Global K a
Variables
You can use Hthe
l
eERASE l i c en to remove a global variable. Globals always allocate 255 bytes
built-in
u l ahTo ensure that performance is not impacted more than necessary, always erase any
of storage.
bd variable when it is no longer needed.
Aglobal
Limits of Use
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1
a b le
er
an sf
- t r
on
s an 2
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a
Using Built-in Definitionsfi se t
K en or a program unit, the Forms Builder enables you to look up
el laictrigger
When you are H writing
built-inla h
definitions, and optionally copy their names and argument prototypes into your code.
d u
Ab 1. Place the cursor at the point in your PL/SQL code (in the PL/SQL Editor) where a built-in
subprogram is to be called.
2. Expand the Built-in Packages node in the Navigator, and select the procedure or function
that you need to use (usually from Standard Extensions).
3. If you want to copy the built-in prototype arguments or name, or both, select Edit > Paste
Name or Edit > Paste Arguments from the menus (Paste Arguments includes both the built-
in name and its arguments).
4. The definition of the built-in is copied to the cursor position in the PL/SQL Editor, where
you can insert your own values for arguments, as required.
mandatory arguments.
Example
The SHOW_LOV built-in is a function that returns a Boolean value (indicating whether the user
has chosen a value from the LOV). It might be called as part of an assignment to a Boolean
variable. This is not a complete trigger.
DECLARE
customer_chosen BOOLEAN;
BEGIN
customer_chosen := SHOW_LOV(’customer_list’);
a b le
er
sf
. . .
t r an
on -
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Useful Built-Ins
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• EDIT_TEXTITEM
• ENTER_QUERY, EXECUTE_QUERY
• EXIT_FORM
• GET_ITEM_PROPERTY, SET_ITEM_PROPERTY
• GO_BLOCK, GO_ITEM
• MESSAGE
• a ble
SHOW_ALERT, SHOW_EDITOR, SHOW_LOV er
• an sf
SHOW_VIEW, HIDE_VIEW
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Useful Built-Ins a fi se t
K
l page n
edescribes
The table onH theenext i c some built-ins that you can use in triggers to add
h l
d u la to items. They are discussed in later lessons.
functionality
Ab
Using Triggers:
When-Button-Pressed Trigger
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a b le
er
an sf
- t r
on
an
GO_BLOCK(‘Stock’);
EXECUTE_QUERY;
s
ha deฺ
)
m Gui
c o
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Using Triggers a fi se t
K en
el licTrigger
When-Button-Pressed
H
This u l ah fires when the user clicks a button. You can define the trigger on an individual item
trigger
d
Aorbat higher levels if required.
When-Button-Pressed accepts both restricted and unrestricted built-ins. You can use buttons to
provide a wide range of functions for users. These functions include:
• Navigation
• Displaying LOVs
• Invoking calculations and other functions
Example
The Stock_Button in the CONTROL block is situated on the TOOLBAR canvas of the ORDERS
form. When pressed, the button activates the When-Button-Pressed trigger. The trigger code
results in navigation to the INVENTORIES block and execution of a query on the
INVENTORIES block.
GO_BLOCK(’INVENTORIES’);
EXECUTE_QUERY;
Using Triggers:
When-Window-Closed Trigger
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k a ou
Summary a i
f se t
K
ela trigger: en
• To produce
H l i c
l-ahSelect a scope in the Object Navigator
d u
Ab - optionCreate a trigger and select a Name from the LOV, or use the SmartTriggers menu
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
Summary (continued) a fi se t
K
el licen trigger provides a wide range of functionality to users.
• The When-Button-Pressed
H
• Use
u l ahthe When-Window-Closed trigger to provide functionality when the user issues a
d
Ab window manager–specific Close command.
Account_Mgr_Lov_Button and that the form exits when you close the Customer
Information window.
4. In the ORDGXX form, write a trigger to display the Products_Lov when the
Product_Lov_Button is selected and that the form exits when you press the Exit_Button.
5. Write a trigger that exits the form when the Exit_Button is clicked.
6. Save, compile, and run the form. Test to see that the LOV is invoked when you press the
Product_Lov_Button and that the form exits when you press the Exit_Button.
7. Create a When-Button-Pressed trigger on CONTROL.Show_Help_Button that uses the
SHOW_VIEW built-in to display the CV_HELP.
8. Create a When-Button-Pressed trigger on CONTROL.Hide_Help_Button that hides the r a ble
CV_HELP. Use the HIDE_VIEW built-in to achieve this. n s fe
9. Create a When-Button-Pressed trigger on CONTROL.Stock_Button thatnuses - trathe
GO_BLOCK built-in to display the INVENTORIES block, and EXECUTE_QUERY a no to
automatically execute a query. s
haWIN_INVENTORY
10. Write a form-level When-Window-Closed trigger to hide m ) the i d eฺ window
c o G u
if the user attempts to close it, and to exit the form
a ilฺ if the
e n t attempts to close the
user
WIN_ORDER window. m
g Stud
Hint: Use the :SYSTEM.TRIGGER_BLOCK e l @ i s system variable to determine what block the
cursor is in when the trigger b
u et
ฺrfires. h
11. Save and compile the(k a f i
form. ClickuRun s Form to run the form and test the changes.
i
af CV_HELP,
The stacked canvas, t o
e is displayed only if the current item will not be obscured.
l K
Ensure, ateleast, that e n
the
sfirst entered item in the form is one that will not be obscured by
H l i c
u l ah
CV_HELP.
d might decide to advertise Help only while the cursor is in certain items, or move the
Ab You stacked canvas to a position that does not overlay enterable items.
The CV_HELP canvas, of course, could also be shown in its own window, if appropriate.
Debugging Triggers
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
@ g Stu
e l is All rights reserved.
Copyrightb© 2006, Oracle.
ฺ r u t h
( k afi o use
a fi se t
K
el licen
h H
u la
b d
A
IT Bangla Ltd
Objectives
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k afi o use
Objectives a fi se t
K
l codecetonyour form by writing triggers, you will probably find that you
As you beginHtoeadd
li or unexpected results. In a large application, it may be difficult to
hobtain incorrect
l a
sometimes
bdu the source of the problem.
Adetermine
You can use Forms Builder’s integrated PL/SQL Debugger to locate and correct coding errors.
This lesson explains how to debug your PL/SQL code.
Debugging Process
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Displaying debug
messages at run le
time r a b
sf e
t r an
on -
• Invoking the
s an
PL/SQL Debugger
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debugging Processafi e t
K
el you s
enmonitor and debug triggers in several ways:
With Forms HBuilder,
l i ccan
l ah
• Compiling:
u Syntax errors and object reference errors (including references to database
d
Ab you to correct these problems
objects) are reported when you compile a trigger or generate the form module. This enables
in the PL/SQL Editor before run time.
• Running a form with run-time parameter debug_messages=Yes: In debug mode,
you can request messages to be displayed to indicate when triggers fire. This helps you to
see whether certain triggers are firing, their origin and level, and the time at which they
fire. If an error occurs, you can look at the last trigger that fired to narrow the scope of the
source of the error.
• Invoking the PL/SQL Debugger: You invoke the Debugger from Forms Builder by
clicking Run Form Debug on the toolbar.
With the Debugger, you can monitor the execution of code within a trigger and other program
units. You can step through the code on a line-by-line basis, and you can monitor called
subprograms and variables as you do so. You can also modify variables as the form is running,
which allows you to test how various changes in form item values and variable values affect
your application.
Debug Console
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a b le
Dock/
er
Variables Undocknsf
- t r a
• Breakpoints on
s a n Right-click
) ha deฺ bar for
c o m Gui Pop-up
m ailฺ dent Menu
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debug Console a fi se t
K en
el is laicworkspace
The Debug Console
H in Forms Builder that enables you to see various aspects of
h
la form and its environment. You can display the Debug Console by selecting Debug >
the running
d u
b Console from the menu. It displays automatically when you encounter a breakpoint in a
Debug
Aform that is running in debug mode.
Within the console, you can display several types of panels: Stack, Variables, Watch, Form
Values, PL/SQL Packages, Global/System Variables, and Breakpoints. You can resize the Debug
Console and any of the panels displayed within it.
You choose which panels to display or close by clicking the toggle buttons on the toolbar of the
Debug Console, or by selecting Debug > Debug Windows from the menu. As you show and hide
panels within the console, the panels automatically expand and contract to fill the console.
You can undock any of the panels to display them outside the Debug Console by clicking the up
arrow in the top right of the panel; you redock the panel by clicking its downward pointing
arrow.
When you right-click the area beside the dock/undock arrow, a pop-up menu is displayed. This
enables you to hide, dock, or undock the panel.
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debug Console: Stack a fi Panel
s e t
K
el licthe enchain of subprograms starting from the initial entry point to the
The call stack
H represents
l
currently
u ahexecuting subprogram. The program currently executing in the example above is
bd
EMPLOYEES.SAL.CHECK_PCT,
Aprogram which was called by EMPLOYEES.SAL.GET_SAL. This
was called from a When-Button-Pressed trigger, the initial entry point of the current
call stack. As you can see, frames are listed in the reverse order in which the subprograms were
executed. The earliest frame is at the bottom of the stack, while the latest frame is at the top of
the stack.
A stack frame contains information about the corresponding subprogram, including the module
name, the package name if any, the subprogram name, and the next statement that is to be
executed. For example, EMPLOYEES.SAL.GET_SAL::19 indicates that line 19 of
subprogram GET_SAL in the SAL package contained in the EMPLOYEES module will be
executed when the application returns to that subprogram. When that occurs, the
EMPLOYEES.SAL.CHECK_PCT frame will get pushed off the stack because the
EMPLOYEES.SAL.CHECK_PCT subprogram has finished executing.
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
Read-only:
) ha deฺ
Modifiable: c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
a
Debug Console: Variables fi Panels e t
K
el displays enthe variables of the current stack frame, along with their values.
The variablesHpanel
l i c
l
There is
u aahpop-up list from which you can select the stack frame whose variables you want to
bd You can also switch the variables shown in the variable panel by clicking a different stack
view.
Aframe in the stack panel if it is open as well. This does not change the order of execution of
program statements, but only the information that is displayed in the Debug Console.
A feature of the Debugger is that when the form is suspended, you can change the variable
values by clicking in the value column and entering a new value. When the program continues, it
will use the new value that you have entered, so that you can test the effect of changing a value
on the final result.
Some variables, such as parameters, cannot be modified. When you click a read-only variable,
the entire cell is highlighted. Clicking a modifiable variable highlights only the value, not the
entire cell.
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debug Console: Watch a fi Panel
s e t
K
el lmay n dozens of variables that can be displayed in various panels in
ehave
A running application
H i c
l
the Debug
u ahConsole, but there may be very few that you need to monitor. The Watch panel
bd a central place where you can keep track of any valid variables that you specify. Only
Aprovides
variables that resolve to a scalar value are valid. Stored package variables are not valid.
After a variable is displayed in your watch list, when execution is next suspended at a different
location, the variable values in the list are updated as needed if they are available in the current
execution context. If a variable is not defined in the currently executing subprogram, “####” is
displayed in the cell instead of a value.
To add a variable to the Watch panel, perform the following steps:
1. Open the window where the variable is displayed.
2. Select the variable that you want to add to the Watch panel.
3. Right-click the selection and choose Add to Watch from the pop-up menu.
To delete an item from the Watch panel, perform the following:
• Select the item in the Watch panel, right-click, and choose Remove from the pop-up menu.
• To clear the entire Watch panel, choose Remove All.
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debug Console: Form a fiValuess e t
Panel
K
l Values en panel to display the values of all items and parameters in modules
You can use H theeForm i c
that arela h
currently
l
running. You switch between a view of items and a view of parameters by
d u
Ab
clicking the corresponding tabs in the panel.
You can change the values of modifiable items to test the effects of such changes. If the value is
read-only, such as display item values, the entire cell is highlighted when you try to edit it. If the
value is modifiable, only the value in the cell is highlighted when you select it.
Debug Console:
PL/SQL Packages Panel
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Stack
• Variables
• Watch
• Form Values
• PL/SQL
Packages
• Global/System a ble
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Debug Console: PL/SQL a fi Packages
s e t Panel
l K
ePackages n to browse and examine PL/SQL packages that have been
epanel
Use the PL/SQLH l i c
l ah Both package specification and package body global variables are listed. You can
instantiated.
u
bd packages only while the runform process is currently executing PL/SQL. You can also
Aview
select an option button to determine which packages are displayed: Client, Server, or All.
Debug Console:
Global/System Variables Panel
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Stack
• Variables
• Watch
• Form Values
• Loaded PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
a fi se t Variables Panel
Debug Console: Global/System
K en panel to display the current system, global, and command-line
el liVariables
Use the Global/System
H c
l
variables
u ahand their values. You can switch among these types of variables by clicking the
bd
Acorresponding tabs in the panel.
Command-line variables and most system variables are read-only. The only modifiable system
variables are DATE_THRESHOLD, EFFECTIVE_DATE, MESSAGE_LEVEL, and
SUPPRESS_WORKING. You can modify global variables, and the new values will be used
subsequently by the running application.
• Stack
• Variables
• Watch
• Form Values
• Loaded PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
a fi sePanel
Debug Console: Breakpoints t
K en of two tabs:
elpanelliconsists
The Breakpoints
H c
l ah
• Breakpoints
u tab:
d
Ab - Displays any breakpoints set in the code during the current Forms Builder session, in
order of breakpoint creation
Display includes:
Name of trigger or program unit
Line number where breakpoint is set
A check box to temporarily enable or disable the breakpoint
- Enables navigation to source code where breakpoint is set:
By double-clicking the breakpoint name
By highlighting (clicking) it, then choosing View Source Code from the pop-up
menu (right-click in Windows). From this pop-up menu, you can also remove the
breakpoint or remove all breakpoints.
Debug Console
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
• Stack
• Variables
• Watch
• Form Values
• Loaded PL/SQL
Packages
• Global/System a b le
er
Variables an sf
- t r
• Breakpoints on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
a fi sePanel
Debug Console: Breakpoints t (continued)
l K
eExceptions n Displays a list of frequently used system exceptions that you can
etab:
• Break On H l i c
l
use
u ahduring debugging. The display includes:
d
Ab -- Associated
Exception name
ORA-error number
- Check box which you use to set or unset the breakpoint
• Suspend form
execution
• Return control
to the Debugger
• Remain in effect
for the Forms
Builder session After setting breakpoint:
a b le
• May be enabled er
and disabled an sf
- t r
• Are set in the on
PL/SQL Editor s an
) ha deฺ
on executable
c o m Gui
lines of code m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Setting Breakpointsain fi Client
s e t
Code
K
el inlcode enso that the form running in debug mode is suspended when a
You set breakpoints
H i c
l ahis encountered and control returns to the Forms Builder Debugger, allowing you to
breakpoint
u
bd or change the environment at that point. When you set a breakpoint, it remains set until
Amonitor
you exit the Forms Builder session. However, you can disable and enable breakpoints as needed
by unchecking and rechecking the check box in the Breakpoints panel of the Debug Console.
You can set breakpoints only on executable lines of code, such as assignments or subprogram
calls. There are three ways to set a breakpoint:
• By double-clicking to the left of a line of code in the PL/SQL Editor
• By right-clicking a line of code and selecting Insert/Remove Breakpoint
• By choosing Debug > Insert/Remove breakpoint from the main menu
Performing the same action again unsets the breakpoint. You can also remove one or all
breakpoints from the pop-up menu in the Breakpoint panel, as described previously.
( k a ou
Setting Breakpointsain i
f Stored e t
Code
K
el tolithe n s
edatabase,
If you are connected
h H c you can set breakpoints in stored packages, procedures, and
Debugging Tips
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k afi o use
General Tips to Solve a fiTrigger
s e t
Problems
K
l youcare
ethat enconnected to the (correct) database when you compile triggers that
• Make sure
H i
l
u l ah SQL. Error messages can be deceiving.
contain
d PL/SQL Editor reports the line that fails, but the error may be due to a dependency on
Ab• The
an earlier line of code.
• Missing semicolons (;) and mismatched quotation marks are a common cause of compile
errors. Check for this if a compile error does not give an obvious indication to the problem.
• If a trigger seems to fire too often, or on the wrong block or item in the form, check
whether it is defined at the required level. For example, a form-level When-Validate-Item
trigger fires for every changed item in the form. To check this, you can run the form with
Debug Messages on.
• For triggers that populate other items, make sure the trigger belongs to the object where the
firing event occurs, not on the items to be populated.
Run Form
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
(Compiles automatically)
Debug
Contains source
code and .FMX (Runs automatically)
executable run file
Runs Form in
debug mode on
a b le
server specified er
in Runtime an sf
- t r
Preferences
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Running a Form in Debug a fi Mode s e t
K
l button
eDebug enin Forms Builder runs the form in debug mode. When a breakpoint
The Run Form H l i c
l ah and control passes to the Debugger in Forms Builder, you can use the debug
is encountered
u
bd
Acommands to resume execution or step through the code in a variety of ways to see how each
line affects the application and the environment, as you will see shortly.
As when you run a form from Forms Builder with the Run Form button, the Run Form Debug
button runs the form in a three-tier environment. It takes its settings from the Preferences
window that you access by choosing Edit > Preferences from the main menu and clicking the
Runtime tab.
You enter the URL for the application server that you want to run the form, which runs in your
default browser unless you specify a different browser in the Web Browser Location field. You
can use a named configuration, if desired, with the config parameter.
Example of Application Server URL
http://mymachine:8889/forms/frmservlet?config=test
where test is a named section in the Forms Web configuration file(formsweb.cfg by
default) that specifies settings to use.
a b le
er
an sf
OK, I’ll use that host
n - t r
Application
Application and port to attach to nodeveloper
user your process. as a
)h ฺ
m ide
i l ฺ co t Gu
g ma tuden
Copyrightb©e
l@ isAllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Remote Debugging af i e t
K s
en that is running remotely within the intranet. The application
el anliapplication
You can alsoH debug c
u l ah debugged makes a call to the DEBUG.ATTACH built-in procedure. This displays a
that is being
bd box containing host and port information, which the developer can then use from Forms
Adialog
Builder to attach to the problem session in order to debug it. A direct socket connection is
needed, so remote debugging is usually not possible over the Internet unless the firewall allows a
direct socket connection.
This ability provides developers with a great head start in resolving problems. Rather than
having to obtain a list of instructions from an end user on how to reproduce the problem, they
can watch the problem happen as the user carries out the actions. If you want to enable remote
debugging, consider adding a hook into DEBUG.ATTACH within all your application screens for
activation by the user as required.
In the example illustrated in the slide, the application developer has created a button that calls
DEBUG.ATTACH. With such a button or menu option, the user can find out the host and port to
convey that information to the developer who is debugging the problem.
Attach Debug
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Attach Debug to
( k afi o use
Remote Debugging a fi se t
(continued)
K
el aboutlictheenhost and port of the running application, the developer can attach to
With information
H
l ah by invoking the Debug > Attach menu option in Forms Builder. This invokes a
that process
u
bd in which to enter the host and port information.
Awindow
After it is successfully attached, the developer can open the .fmb file from which the running
.fmx was generated and set any breakpoints in the code that will assist in debugging the
problem described by the user.
In the example illustrated above, the user describes a nonfunctioning Exit button. The developer
opens the When-Button-Pressed trigger for that button and sets a breakpoint in the first line of
code, then instructs the user to click Exit to invoke the code.
When the process encounters a breakpoint in the code, the control passes to the Debugger. This
can cause confusion for the user because the browser’s applet window may go blank, just as it
does when running in debug mode to test a form in Forms Builder.
The developer can view the Debug Console and its panels and step through the code as needed to
debug the problem. The developer does not see the running application. If user interaction is
needed (such as responding to an alert), the form reappears in the client browser and the user
regains control until the response is given, at which point the control passes back to the
Debugger.
Stop
Step Step
into out
a b le
er
an sf
- t r
on
s an
Go ) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
Copyrightb h
ฺ r u t
© 2006, Oracle. All rights reserved.
( k afi o use
Stepping Through Codea fi se t
K
el a form n is running remotely or from Forms Builder, when the program
ethat
Whether debugging
H l i c
l aha breakpoint, the Debugger enables you to step through program units in a variety of
encounters
u
bd by using the following buttons:
Aways
• Step Into: Executes the next statement, whether in the current code or a subprogram
• Step Over: Executes the next statement without stepping into a nested subprogram
• Step Out: Completes the nested subprogram and steps to the next executable statement in
the calling program
• Go: Resumes execution until the program terminates normally or is interrupted by the next
breakpoint
• Pause: Pauses the execution of running PL/SQL code to enable you to examine the
environment (for example, you could check variable values)
• Stop: Terminates debugging and program execution completely; the Debug Console and
any opened debug panels close and application execution terminates
Another command, available from the Debug menu, is Run to Cursor. When you place the
cursor on a line of code in the PL/SQL Editor (by clicking on it), the Run to Cursor
command executes all code up to that line, and then stops and marks that line as the next
executable line of code.
Debug: Example
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Debug example
Procedure XYZ;
a b le
er
sf an
- t r
2 n4on
s a
Function ABC;
a
3) h ideฺ
m
co t Gu
i l ฺ
g ma tuden
Copyrightb ©e
l@ isAllSrights reserved.
f i ฺ ru se th
2006, Oracle.
( k a ou
Debug: Example af i e t
K s
en some of the basic features available in the Debugger. The
el demonstrates
This simple example
H l i c
h consists of a single button with trigger code for the When-Button-Pressed event.
example
u l aform
bdcode works as follows:
AThe
1. The trigger calls the XYZ procedure, passing it a value for the xyz_param input
parameter.
2. The XYZ procedure calls the ABC function, passing it a value for the abc_param input
parameter.
PROCEDURE xyz(xyz_param IN NUMBER) IS
v_results NUMBER;
BEGIN
v_results := ABC(10);
v_results := v_results + xyz_param;
MESSAGE(‘The results are: ‘ || TO_CHAR(v_results));
END xyz;
3. The ABC function multiplies two variables and adds the result to the abc_param input
parameter.
4. The ABC function returns the result to the XYZ procedure.
a ble
er
an sf
- t r
on
s an
) ha deฺ
c o m Gui
m ailฺ dent
e l @g is Stu
f i ฺ rub se th
( k a ou
a i
f se t
K
el licen
h H
u la
b d
A
Summary
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
( k afi o use
Summary a fi se t
K enForms Builder, you can:
elfrom lwithin
To debug a form
H i c
l
• Click
u ahRun Form Debug (compiles and runs the form automatically)
d
Ab• Set breakpoints in the code
• Use various panes of the Debug Console to view aspects of the running form
• Use the debug-related toolbar buttons to step through the code
( k afi o use
Practice 15: Overview a fi se t
l K
esession, enwill run a form in debug mode from within Forms Builder, set a
In this practice
H l i c
you
l ah and step through code, looking at variable values as the form runs.
breakpoint,
u
bd For solutions to this practice, see Practice 15 in Appendix A, “Practice Solutions.”
ANote: