You are on page 1of 7

Step 1: Creating the Form with the Bean

Open Form Builder and create a simple form called hyperlink.fmb that uses the
Hyperlink bean. Here are the steps:

a. Create a form with a canvas.


b. Create and on-logon trigger with a null in it.
c. Bring up the canvas and create a bean item on it.
d. Bring up the property palette and name the bean HYPERLINK.
e. Rename the block that was automatically created in step c to CONTROL.
f. Create a WHEN-NEW-FORM-INSTANCE trigger at the module level with the
following code:

DECLARE
hHyperlink ITEM:=FIND_ITEM('CONTROL.HYPERLINK');
BEGIN
FBean.Register_Bean(hHyperlink,1,'oracle.forms.demos.beans.Hyperlink');
FBean.Invoke(hHyperlink,1,'setURL','http://otn.oracle.com/products/forms');
FBean.Invoke(hHyperlink,1,'setLabel','Forms on OTN');
FBean.Enable_Event(hHyperlink,1,'actionListener',true);
END;

The above sample uses the Fbean package, which is a new feature in Forms 9i.
It provides a means to register the properties and methods of Arabians at run
time and make setter and getter methods available from PL/SQL in Forms. As
you can see, the above lines are registering the bean, setting the URL and
Label and enabling a listener.

g. On the 'CONTROL.HYPERLINK' item add a WHEN-CUSTOM-ITEM-EVENT


trigger with
the following code:

DECLARE
vcEventData VARCHAR2(256);
BEGIN
vcEventData := Fbean.Invoke_Char('CONTROL.HYPERLINK',1,'getURL');
WEB.SHOW_DOCUMENT(vcEventData,'_blank');
END;

This code simply gets the URL in response to a mouse click and uses the Forms
WEB.SHOW_DOCUMENT to display it.

You will not be able to see the hyperlink in the layout editor. It will only
display when you run the form after configuring your environment to find the
bean.
Step 2: Finding the Bean

Before the bean class files can be found they must be placed in the appropriate
location. Once you have installed the Forms 9i Demos a "demo" directory will be
created under the 9iDS_Home\forms90 directory. This directory contains the
Hyperlink bean as well as a number of others. There are two ways to ensure the
Hyperlink bean's class files can be found by your form when running it from the
9iDS Form Builder:

The easiest method is to place the hyperlink.jar file in the


9iDS_HOME\forms90\java directory. This is the recommended method for deploying.
For development purposes one may find it more convenient to move the appropriate
bean class file to the appropriate codebase directory structure. Here are
descriptions of each method:

Method 1 - The JAR Method:

a. Locate the hyperlink.jar file located in D:\9iDS\forms90\demos\hyperlink\classes.


b. Move the hyperlink.jar file to 9iDS_HOME\forms90\java.
c. Find the formsweb.cfg file in 9iDS_HOME\forms90\server.
d. Add the following configuration section to the file:

[hyperlink]
archive_jini=f90all_jinit.jar,hyperlink.jar
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue

The archive_jini parameter pointing to hyperlink.jar is the most important part


of this configuration.

e. Now go into Form Builder and accomplish the following:


Edit->Preferences->Runtime Tab
Add the config parameter to your "Application Server URL". It should look
something like this:

http://machine.domain:port/forms90/f90servlet?config=hyperlink

Method 2 - The Codebase Method


This method is not recommended for deploying your application but is handy
for development purposes. It allows you to run the test the bean from the Form
Builder without defining a default configuration file in your in the Form
Builder's "Application Server URL" value.

a. Create a directory called "demos" in the 9iDS_HOME\forms90\java\oracle\forms


directory.
b. Create a directory called "beans" within "demos" directory created above.
c. Copy the Hyperlink.class file to:
9iDS_HOME\forms90\java\oracle\forms\demos\beans

The Hyperlink.class file can be found in:


9iDS_HOME\forms90\demos\hyperlink\classes\oracle\forms\demos\beans.
d. Now go into Form Builder and accomplish the following:
Edit->Preferences->Runtime Tab
Verify the "Application Server URL" looks like:

http://machine.domain:port/forms90/f90servlet

Once you have created the form you can see it work from inside Form Builder using
either deployment method by just running the form using the "Run Form" button.
The "Forms on OTN" hyperlink will appear on the form if there are no set up errors.
Clicking on the link should take you to:
http://otn.oracle.com/products/forms.

You also can run the form outside of Form Builder. Here are the ways, depending on
the deployment method:

Method 1 - In your browser type:

http://machine.domain:port/forms90/f90servlet?config=hyperlink&form=hyperlink

Method 2 - In your browser type:

http://machine.domain:port/forms90/f90servlet?form=hyperlink

Again, the recommended method for deploying is method 1 but either method can
be used to deploy the bean form to a 9iDS Release 2 environment.

Note: The Hyperlink bean also comes with a sample form found in
9iDS_HOME\forms90\demos\hyperlink\forms and documentation, which can be
found in 9iDS_HOME \forms90\demos\hyperlink\doc\hyperlink90.html.

Accepted Solution
04/18/06 06:12 PM, ID: 16483564
KG1973:
Hi Schwertner,

Wow!!!! That's really something for me and I never thought such a quick response.
This is the reason why I joint / subscribe Expert-exchange forum.
I don't know yet whether this will work for me or not.
But I am happy that there is a place for me to discuss my difficulties and get the solution
interactively.

Thanks a million and I will try this once I understood well all those steps.

04/18/06 06:41 PM, ID: 16483712


KG1973:
Schwertner.

Sorry before I continue, I am currently using Oracle Develope Suite 10G which I think
not so much different with 9i form. However if there is any major different, will all those
steps that you elaborated be changed as well ?

thanks.

04/18/06 11:22 PM, ID: 16484820


schwertner:
I also use Oracle Develope Suite 10G (but the version only called so, in fact it is 9.4......).
No, I am sure that this feature is not oblelete.
Also a good approach is to use online help of Forms.

05/07/06 05:22 AM, ID: 16624958


KG1973:
Hi schwertner,
Today I tried all step that you suggest.
1st try, it failed. I noticed that "f90all_jinit.jar" file is not found because I am using 10G
instead of 9ids. But after I replaced with "frmall_jinit.jar", the form displayed without
error.

But when I click to the hyperlink, somehow the explorer blocked it. I tought this is just a
small problem. "Popups were blocked in this page, press and hold control......". But after
I set my firewall "allowing all", the problem still remain. Strange ? Is this anything to do
with my form OR just simply my explorer ? Another thing is, what if I want to add
another link ? Do I have to repeat Step1 f ?

Thanks in advance.
05/08/06 12:03 AM, ID: 16628382
schwertner:
Popup blocked -----> It is feature of the browser. Go to the browser properties and allow
popups.

http://unodocs.nmsu.edu/RoboDocs/WebHelp/jinitiator/ji_04.htm

In order for Internet Explorer to download JInitiator automatically, you need to disable
"Pop-up" blocking.
To do this, go to "Tools","Pop Up Blocker", and select "OFF"
After you've successfully installed JInitiator, you can turn Pop-up blocking back on.
To do this, go to "Tools","Pop Up Blocker", and select "ON".

05/08/06 02:51 AM, ID: 16629293


KG1973:
I already did that. Strange thing is The Demo runs ok, even if I set the blocker on.

05/10/06 06:34 AM, ID: 16648434


KG1973:
Hi Schwertner,
I have accepted your solution even the hyperlink were still blocked by pop-up blocker.
But I would be grateful if you can tell me other possibilities that may cause such problem
and how to maximise the form so that it can utilised the whole screen as normal IE does.

Thanks a million.

05/10/06 11:40 PM, ID: 16655724


schwertner:
I will do my best to help you.

05/10/06 11:59 PM, ID: 16655779


schwertner:
What is your OS?
Do you use firewalls? XP uses default firewall, turn it off.
Look for hidden firewall products in the Processes list.
Antiviruses? Turn of!

Use the latest versions of Dev. Suite!


E.g. forms 9i can not run against OAS 10g!
Same for the OAS - latest version!

---------INFO-----------------
The Forms9i Demos currently do not come with 9iDS Release 2 (9.0.2.0.1) and
must be downloaded from otn. You can download them from:

http://otn.oracle.com/sample_code/products/forms/content.html

On this page you will see the ReadMe and Source for the ?The Oracle9i Forms
Demos.? You can click on the Source link and download them to your computer and
unzip them. Now follow these instructions to install them:

1) Download Jinitiator 1.3.1.9 from OTN if you don't have it installed


2) Unzip the file into a suitable temporary folder e.g. c:\temp\9idemos
3) Start the 9iDS OC4J before installing
4) Start the Universal installer from the Oracle Installation Products start
menu option. This should be Oracle Universal Installer 2.1.
5) Point the installer at the (c:\temp\9idemos\)products.jar file and select
your 9iDS Oracle Home as the home to install into.
6) Follow the installer instructions
a) You will next see a screen that asks for the OC4J Admin Port and Password.
If you did a default install of 9iDS Release 2, you can take the defaults.
b) Enter Database Information
c) Decide if you wish to do a complete install of the demos. If you wish to
use only a few of the beans, such as the hyperlink, getclientinfo, keyfilter,
etc., you will not need to install the DB objects.
d) The next screen just explains how to install the demo schemas should you
choose to do so later.
e) The following screen gathers DB information for installing the demo
schemas.
f) The demos need to know where Jinitiator 1.3.1.9 is installed so enter it
on this screen.
g) Now you are ready to install them.
7) Once you have completed the installation the demos will be installed in the
9iDS_home\forms90\demos directory.

This set of demos is only intended for installation into an Oracle9iDS


Oracle Home on Windows NT or 2000

20090114-EE-VQP-51
• About Us|
• Contact Us|
• Member Agreement|
• Internet Rank|
• Privacy Policy|
• Site Map

You might also like