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