PJC and JavaBean Demos

The following menu gives you access to a variety of Forms which have extended client capabilities provided by Java.  This Java is used as a Pluggable Java Component or Java Bean which can be integrated into the Form by the use of the implementation class property on and item or by using the new FBean package in PL/SQL.

This menu itself uses a PJC which extends a standard Forms button - The "InfoButton" PJC   

InfoButton PJC Information

The InfoButton Pluggable Java Component (PJC) is used in the Demo launch form to provide a simple menu system.  The PJC itself is an enhanced version of a normal Forms button. The button can have rounded edges if required to provide compatibility with the Oracle Look and Feel, but it's most important feature is to be able to display text in another field as the mouse moves over the button (rather like a supercharged tooltip).

The text is displayed in another Forms Item, a nominated multi-line text area, as the mouse moves over the button. This all happens in the Forms Java applet without round trips to Forms services on the middle tier. 

Modules In This Demo

The InfoButton demo consists of the following files (relative directories shown in brackets):

  1. pjclaunch.fmb/fmx [forms]- The demo form that uses several InfoButtons to create a "menu"
  2. InfoButton.java [src/oracle/forms/demo/enhancedItems] - source code for the enhanced button
  3. infobutton.jar [classes]- the compiled and jarred InfoButton class.

The doc directory and the classes directory contain the JavaDoc for the code and the compiled class respectively

Reusing the code

Setting up Forms Services

In order for an application to be able to use the InfoButton PJCs the relevant configuration in the formsweb.cfg file has to ensure that the supplied infobutton.jar (or another jar file containing the compiled InfoButton class) is included in the relevant archive setting.

An entry in the formsweb.cfg file for an application that used the InfoButton PJC  would look like this:

[PJCDemo]
pageTitle=OracleAS Forms Services - InfoButton Demo
IE=jinitiator
baseHTMLJInitiator=demobasejini.html
archive_jini=frmall_jinit.jar,infobutton.jar
form=pjclaunchforms/java
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue
background=/formsdemo/images/blue.gif

Using the PJC in your Form

You must first create a normal Forms button, then set the Implementation Class property for this button to oracle.forms.demos.enhancedItems.InfoButton.  Note that this property is case sensitive and must be entered exactly as shown.

The enhanced button has the capability to have either or both edges rounded in an Oracle Look and Feel style. To round a button edge, simply prefix or suffix the button label with an opening or closing round bracket.  For instance (Press Me) as the label property for the button would result in a button with both edges rounded and the label "Press Me" (the brackets are removed in the final label)

Setting up the InfoButton

To set up the actual tool-tip functionality up on an InfoButton PJC you need to set two custom properties:

  1. Set the text for the "tool-tip": Use the custom property INFOBUTTON_TEXT with a value of the required test to be displayed when the mouse moves over the button.
     SET_CUSTOM_PROPERTY('MENU.BUTTON1',1,'INFOBUTTON_TEXT','The is the first choice in the Menu');

The first argument to Set_Custom_Property() is the name or id of the PJC enabled item.  The second parameter defines the instance of the control that you wish to set the property on.  This index number is one based and represents the physical control in the user interface (rather than the record number in the underlying block). You can use the constant ALL_ROWS to set the property on all instances of the PJC for this field.  The third argument is the custom property that is being set on the PJC and the forth the value.

  1. Define the position of the Display text item: Use the custom property INFOBUTTON_FIELDPOS.  This property should be set to a string containing a X,Y comma separated pair providing the location of the target field in pixels relative to the top left hand corner of the window.  The X,Y pair simply has to define a point anywhere within the target field, it doesn't have to exactly define the corner.
     SET_CUSTOM_PROPERTY('MENU.BUTTON1',1,'INFOBUTTON_FIELDPOS','100,20');

Custom Property Summary

Property Get Set Valid Values / Return Value Purpose
INFOBUTTON_TEXT No Yes <string value> The hint text to display in the target field
INFOBUTTON_FIELDPOS No Yes X,Y pair as a String The position of the target field to display the hint text into.
DEBUGMESSAGES No Yes 'true' | 'false' Enables/disables debugging to the Java Console for this instance of the control.
DEBUGMESSAGES_ALL No Yes 'true' | 'false' Enables/disables debugging to the Java Console for all instances of the control.