Overblog Suivre ce blog
Administration Créer mon blog
3 avril 2011 7 03 /04 /avril /2011 07:57

When you migrate to the latest Forms version (10.1.2.3 or 11) and try using a JavaBean created with an older Forms version, you can get the following error, at runtime, in the Java Console:

Exception in thread "thread applet-oracle.forms.engine.Main-1" java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet

The reason is you try to use a Java Bean compiled with an older Forms JAR file, like f90all.jar.
So, to correct the issue, you have to change the Java code then re-create the JAR file:

private Main         formsMain = null;

Replace:

    formsMain  =  (Main) handler.getApplet();

by:

     // getting the Forms Main class
    try{
      Method method = handler.getClass()
                     .getMethod("getApplet", new Class[0]);

      Object applet = method.invoke(handler, new Object[0]);
      if (applet instanceof Main) {
         formsMain = (Main)applet;
      }    
    }catch(Exception ex) {;} 

Then create and deploy the new JAR file to your /forms/Java folder.

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
6 février 2011 7 06 /02 /février /2011 13:21

Purpose

Here is a Pluggable Java Component from Andreas Weiden, to have expandable/collapsable canvas.

It allows a simple Push Button Item to expand/collapse the whole content of a canvas like a Tree item.

Accordion Java Bean



The Java source
 

     AccordionButton.java



The implementation class of the PJC (PushButton Item)


     forms.AccordionButton


The PJC initialisation

     Read the content of the PK_AKKORDION.txt file from the zip file




The sample dialog

     .
Download the accordion.zip file
     . Unzip the accordion.zip file
     . Copy the accordion.jar file in your /forms/java/ folder
     . Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the ACCORDION.fmb and ACCORDION2.fmb modules (Oracle Forms 10.1.2.0.2)
     . Compile all and run the module

 

Repost 0
Published by Oracle Forms community - dans PJC - Buttons
commenter cet article
11 décembre 2010 6 11 /12 /décembre /2010 14:40

Purpose

Here is a Simple Horizontal Scrolling Marquee Java Bean proposed by Omama Khurshid from Taxila Pakistan.

She is working as Software Engineer at Pakistan Revenue Automation Limited Islamabad Pakistan from 3 years and working on PJC from at least 1.5 years for developing different functionality in Oracle forms 10g.
Email address: omamadr@yahoo.com


Text Filed Menu



The Java source
 

     Banner.java



The implementation class of the PJC


     mypackage.Banner


The methods you can call



  • Set the text

Set_Custom_Property ('Blk.Bean',1,'SET_MARQUEE','text#xpos#ypos#textwidth#textheight#fontface#fontsize#fontstyle#fgcolor#bgcolor') ;

Text = 'Some Text '
xpos = 700
ypos=25
width=100
height=25
fontface = 'Serif'
fontsize =16
fontstyle= [I|B|P|BI]
foregroundcolor =r255b0g0
BackgroundColor =r0g0b0
Set_Custom_Property ('Blk.Bean',1,'SET_MARQUEE','Hi I m here #700#25#100#25#Arial#16#I#r255b0g0#r0g0b0') ;

 

  • Stop the marquee

Set_Custom_Property ('Blk.Bean',1,'STOP_MARQUEE','') ;




The sample dialog

     .
Download the marqueePJC.zip file
     .  Unzip the marqueePJC.zip file
     .  Copy the banner.jar file in your /forms/java/ folder
     .  Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the banner.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar file must be signed
     The jar file provided with the .zip file is already signed


Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
21 septembre 2010 2 21 /09 /septembre /2010 07:24

Here is a Java Bean to attrack the attention of the end-user when a message is displayed in the status bar.

It "flashes" the status bar using different colors, depending on the message severity.

 

Get This Java Bean created by Andreas Weiden.

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
7 janvier 2010 4 07 /01 /janvier /2010 15:31

Purpose

Here is a Forms 11g Pluggable Java Component that allows sending back to the Forms application each key pressed in a Text Item (single or multi-line).

The single-line PJC extends the VTextField class.
The multi-line PJC extends the VTextArea class.



Key Pressed 11g


This PJC can only work with the Forms 11g version. It won't work with any older version like 10g or 9i.


The implementation class of the single-Line Text Item


     oracle.forms.fd.KeyPressedTextItem


The implementation class of the multi-Line Text Item

     oracle.forms.fd.KeyPressedTextArea



The methods you can call



Set the Java Console logging mode (true/false)

Set_Custom_Property('BLOCK.ITEM',1,'LOG','true|false');

By default, the logging mode is set to false.

e.g.:
-- set the logging on --
Set_Custom_Property( 'BL.TEXTITEM', 1, 'LOG', 'true' ) ;
 

 



The event fired by the PJCs


KEY_PRESSED


It is constituted by 3 parameters to get the key code, the key char and the key modifier.

To know what text item has just fired the event, ask the :SYSTEM.CURSOR_ITEM variable.

When-Custom-Item-Event:

DECLARE
  
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    LC$Code   varchar2(25); -- code
    LC$Char   varchar2(25); -- char
    LC$Modif  varchar2(25); -- modifier

  
BEGIN
  
   IF (eventName='KEY_PRESSED') THEN
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'KEY_CODE',eventValueType, LC$Code);
      get_parameter_attr(eventValues,'KEY_CHAR',eventValueType, LC$Char);
      get_parameter_attr(eventValues,'KEY_MODIFIER',eventValueType,  LC$Modif);
     
      :BL.RESULT := :System.cursor_item || ' Key pressed:'|| LC$Code || ' (' || LC$Char||') '||' modif:'||LC$Modif ;
      Synchronize ;

   END IF; 
  
END;






The sample dialog


     . Download the KeyPressed.zip file
     . Unzip the file
     . copy the keypressed.jar file in the <ORACLE_HOME>\Middleware\as_1\forms\java directory
     . Edit your formsweb.cfg file to add the keypressed.jar to the archive tag.
      
<WEBLOGIC_HOME>\Middleware\user_projects\domains\ClassicDomain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg
     . Open the KEYPRESSED11g.fmb module (Oracle Forms 11g)
     . Compile all and run the module

Repost 0
Published by Oracle Forms community - dans PJC - Text items
commenter cet article
6 décembre 2009 7 06 /12 /décembre /2009 10:24


Click to discover                  Click the image to discover

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
17 novembre 2009 2 17 /11 /novembre /2009 20:13

Purpose

Here is a PJC that includes a menu in a Text Item.



Text Filed Menu



The implementation class of the PJC

     oracle.forms.fd.ComboMenuPJC


The methods you can call



  • Set the menu

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_MENU', 'menu_description');

menu_desription contains the menu definition in a XML format:

Declare
 LC$Menu  Varchar2(32000);
Begin
 LC$Menu := '<main>
    <label>Machines</label>
    <menu>
    <label>Cars</label>
    <smenu><label>Japaneese</label><item>Toyota Prius</item></smenu>
    <smenu><label>Europeen</label><item>Mercedes</item><item>BMW</item><smenu><label>French</label><item>Peugeot 207</item></smenu></smenu>
    </menu>
    <menu>
    <label>Planes</label>
    <smenu><label>Airbus</label><item>A350</item><item>A380</item></smenu>
    <item>Boeing 777</item>
    </menu>
    </main>' ;
    Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_MENU', LC$Menu);
End;


The content of a complete sub-menu must be written on the same single line between <smenu> and </smenu> tags.

e.g. :
<smenu><label>Japaneese</label><item>Toyota Prius</item></smenu>

Only values included between <item> and </item> tags are real values you can use to populate the Text Item.


 

  • Set the border style

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_BORDER', 'border');

  border can be one of the following:

   - line  (défault)
   - raised
   - lowered
   - etched
   - null

 

  • Set the trace to the Java Console

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_LOG', 'true');





The sample dialog

     .
Download the combomenupjc.zip file
     .  Unzip the combomenupjc.zip file
     .  Copy the JAR files in your /forms/java/ folder
     .  Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the combomenupjc.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar file must be signed
     The jar file provided with the .zip file is already signed


Repost 0
Published by Oracle Forms community - dans PJC - Text items
commenter cet article
29 octobre 2009 4 29 /10 /octobre /2009 17:54
Jesus Vallejo has created a Java Bean to add a Spell Checker in your Forms applications.



Get it from his site.
Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
4 septembre 2009 5 04 /09 /septembre /2009 10:09
Purpose

This Java Bean is provided by Oleg Tishchenco.

One of the most utilized feature of the Oracle Forms is the LOV. Tough Oracle Forms provide us with plenty of functions and properties to customize LOV's appearance and behavior at runtime we still lack some control on LOV:
  • there is Set_LOV_Column_Property to change column's width and title but there is no any Get_LOV_Column_Property;
  • there is no way to recognize how many columns are there;
  • there is no way to get actual size of the LOV. For some reason Get_LOV_Property( LOV_SIZE ) always returns design time width and height;
This is a JavaBean (java part was done by my coworker Michel Kizhner) that fix these breaches by silently parsing LOV's window structure at runtime and sending the result back to Forms via custom event call. Also to make development easier there is UTL_LOV package that wrap all the details of communication to this JavaBean. With this package you can:
  • get how many columns exists in LOV:
UTL_LOV.Get_LOV_Property( <lov_name>, COLUMN_NAME )
  • get column's width and title:
UTL_LOV.Get_LOV_Column_Property( <lov_name>,<column>, WIDTH )
UTL_LOV.Get_LOV_Column_Property( <lov_name>,<column>, TITLE )
  • get actual size of the LOV:
UTL_LOV.Get_LOV_Property( <lov_name>, LOV_SIZE )
if you need for any reason design time width and height you can get it with
UTL_LOV.Get_LOV_Property( <lov_name>, WINDOW_SIZE )

See UTL_LOV package specification for more details.
 


LOV Java Bean




The implementation class of the Bean Item

     oracle.forms.enhancedLOV

 

 

 


The Java code

 

 

     LOVAddOn.java

 

 

 

 

Properties and events


All properties and events are for internal use only.



The sample dialog

     .
Download the lovaddon.zip file
     . Unzip the lovaddon.zip file
     . Copy the lovaddon.jar file in your /forms/java/ folder

     . Add it to the archive tag of the /forms/server/formsweb.cfg file
     . Open the lovaddon.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     .
Logon as scott/tiger
     .
Navigate to MGR or DEPTNO field and invoke LOV
     .
Dismiss LOV with OK or Cancel then you should see alert described the LOV you just called


For any question concerning this bean, send a mail to Oleg at sch@kled.org.

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article
31 août 2009 1 31 /08 /août /2009 16:20
Purpose

Here is a Java Bean from Jesus Vallejo that
displays a calculator.
 
It cannot run with the JInitiator and needs the Sun Java plug-in.
 


Time Zones Java Bean




The implementation class of the Bean Item

     oracle.forms.jvr.Calculator

 

 

 


The Java code

 

 

     Calculator.java     CalculatorOperations.java

 

 

 

The methods you can call


  • set the frame title

Set_Custom_Property('BL.BEAN',1, 'SET_TITULO','Calculator');



  • Set the label of the button that returns the value of the calculator

Set_Custom_Property('BL.BEAN',1, 'SET_BOTON','Get Value');

  • Set the frame position (x,y)

Set_Custom_Property('BL.BEAN',1, 'SET_POSICION','300,150');


  • Set the initial value

Set_Custom_Property('BL.BEAN',1, 'SET_VALORINICIAL','');


  • Set the calculator mode (E- Standard / C-Scientific) 

Set_Custom_Property('BL.BEAN',1, 'SET_MODO','');


 


  • Show the calculator

Set_Custom_Property('BL.BEAN',1, 'SHOW','');


 

 

The event sent by the Java Bean


CALCULATOR_EVENT
This event tells Forms that a date has been chosen in the calculator.

You can get it in a WHEN-CUSTOM-ITEM-EVENT event:

DECLARE
   
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    valor     varchar2(256); -- Calculator Value
   
BEGIN
   
   IF (eventName='CALCULATOR_EVENT') THEN
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'CALCULATOR_VALOR',eventValueType, valor);
      Clear_Message;
      Message('Calculator Value: '|| valor );
      Synchronize ;           
   END IF;  
   
END;



 


The sample dialog

     .
Download the Calculator.zip file
     . Unzip the Calculator.zip file
     . Copy the Calculator.jar file in your /forms/java/ folder

     . Add it to the archive tag of the /forms/server/formsweb.cfg file
     . Open the Calculator.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar file must be signed
     The jar file provided with the .zip file is already signed


For any question concerning this bean, send a mail to Jesus at vallejo.jesus@gmail.com.

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article