Sunteți pe pagina 1din 4

CraigsOracleStuff

Welcome to Craig's Oracle


Stuff
Oracle Forms - How to's
Forms: Forms Compiler
command line
parameters
Forms: How to Base a
block on a FROM Clause
Query

Search this site

Oracle Forms - How to's


>

Forms:HowtoCreateaContext(Popup)Menu
Introduction

Forms: How to Base a


data block on a
procedure using the
Advanced Database
options (ADo)

If you are like me, you probably havent had an opportunity to use a Forms Popup (Context) menu before. Recently, I was presented with
an opportunity where a Popup menu made sense and would make the user experience better. Since I had never used one before it took me
a little time to research how to create and use one. As I was researching how to do this I discovered that there really wasnt very much
published information on how to use a Popup menu and Popup menus are not very well documented in the Forms Help system. So, I
decided to write this little How to document to demonstrate how I implemented a Popup menu.

Forms: How to base a


Data Block on a table join

My customer wanted a Popup menu to let them Copy, Cut and Paste a value from one item to another.

Forms: How to Check for


Duplicates using a
Record Group
Forms: How to Configure
Forms Builder to run
forms locally
Forms: How to Create a
Context (Popup) Menu
Forms: How To Create a
Hierachical Tree form
Forms: How to Create a
Multiline Text Counter
Forms: How to Create an
Object List Report from
the command line
Forms: How to
Dynamically Populate a
Poplist

First off, I found it strange that Oracle Forms calls this menu a Popup. Standard User Interface (UI) programming refers to this type of
menu as a Context menu. Since we are working with Oracle Forms, I will continue to refer to this menu as a Popup instead of the industry
standard of Context.

Disclaimer
This demonstration is written using Oracle Developer Suite 10g Release 2 (10.1.2.0.2) with no patches installed. This makes the demo files
included with this article usable by any version of Forms 10g. The concepts presented in this demo work with Forms 6i and 9i without any
changes at all.
This demo assumes you have access to the HR demo schema.
Lets get started
Start the Forms OC4J Instance and then Forms Builder and connect to the HR demo schema. Create a new Forms module and create a new
Data Block using the Data Block Wizard. Select the EMPLOYEES table and accept all of the default settings specified by the data block
wizard to include creating a canvas (selecting the Form layout). You should have something similar to the following:

Forms: How to Select


Multiple Records in a
block using Record
Groups
Forms: How to use a
calendar in a Form

Terjemahkan

Oracle Forms WebUtil


1-WebUtil: A simplified
guide to understanding
WebUtil
2: Configure WebUtil for
Forms 10g R2
WebUtil: How to Read an
Excel file into an Oracle
Form
PL/SQL
PL/SQL: Send Email from
the database
Sitemap

Now, lets create the Popup Menu, so scroll to the Popup Menus node of the Object Navigator and add (click on the node and click the +
toolbar button) a popup menu object. Once added, right click the object and open the Property Pallet. Rename the object to
CONTEXT_MENU. No other properties need to be changed at this point.
Now, lets add the three menu options; Copy, Cut and Paste so click on the CONTEXT_MENU object and add three new menu items. Click
on the first new object and then open the property pallet. Change the following properties:
1. Menu Item 1:
a. Name = COPY
b. Label = Copy (Ctrl + C)
c. Magic Item = Copy
d. Menu Item Code = COPY_REGION;
2. Menu Item 2:
a. Name: CUT
b. Label: Cut (Ctrl + X)
c. Magic Item = Cut
d. Menu Item Code = CUT_REGION;
3. Menu Item 3:
a. Name = PASTE
b. Label = Paste (Ctrl + V)
c. Magic Item = Paste
d. Menu Item Code = PASTE_REGION;
Your form should now look similar to the following:

Now we need to assign the Popup menu to each item in the EMPLOYEES block. The easiest way to do this is to select all of the items in the
block and open the property pallet. Scroll to the Popup Menu property and select the CONTEXT_MENU from the List of property values. For
example:

Thats it! Youre done! Now just run your form to test. Your form should function similar to the following:

The kicker to this process is that you have to implement the "Popup Menu" on each item you want to use on.
Now that you have completed this little demo, I'm sure you have come to the same conclusion I did; "Boy, that was easy!"

Komentar
Andatidakmemilikiizinuntukmenambahkankomentar.

Masuk | Aktivitas Situs Terbaru | Laporkan Penyalahgunaan | Cetak Laman | Diberdayakan oleh Google Sites

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