PJC - Text items

Lundi 20 mars 2006
Par Oracle Forms community
Ecrire un commentaire - Voir les 0 commentaires - Recommander
Vendredi 13 octobre 2006
Purpose

Here is a PJC that allows to set the cursor from any image stored in the jar file.

This PJC extends VTextField, so you must set the Implementation Class name on a Text item.


Text item and custom cursor


The Java code

     JTextFieldIcon.java



The implementation class of the Bean Item

     oracle.forms.fd.JTextFieldIcon


The methods you can call


Set the image name

Set_Custom_Property('BLOCK.ITEM', 1, 'SETCURSOR', 'image_name');

e.g. :
Set_Custom_Property( 'BL.T1', 1, 'SETCURSOR', '/cursor1.gif' ) ;
   

   images are searched in the jar file.

The jar file provided with the article contains one icon : cursor1.gif


The sample dialog


     . Download the jtextfieldcursor.zip file
     . Unzip the file
     . copy the jtextfieldcursor.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file
     . Open the TEXTCURSOR.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

Par Oracle Forms community
Ecrire un commentaire - Voir les 0 commentaires - Recommander
Lundi 8 janvier 2007
 Purpose

Here is a PJC for textfields that allows to have a blinking behaviour.

Blinking textfield

This behaviour could be easily applied to other kind of items, like Command buttons for instance.


The Java code

     BlinkTextField.java



The implementation class of the Text Item

     oracle.forms.fd.BlinkTextField


The methods you can call



  • Set the blinking rate

Set_Custom_Property( 'BL.BEAN', 1, 'SETBLINKRATE', 'milliseconds' ) ;

  • Set the Foreground color

Set_Custom_Property( 'BL.BEAN', 1, 'SETFGCOLOR', 'r,g,b' ) ;


  • Set the Background color

Set_Custom_Property( 'BL.BEAN', 1, 'SETBGCOLOR', 'r,g,b' ) ;

  • Start blinking

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

  • Stop blinking

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




The sample dialog

   . Download the blink.zip file
   . Unzip the files
   . copy the blink.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the BLINK.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module

Par Oracle Forms community
Ecrire un commentaire - Voir les 0 commentaires - Recommander
Mercredi 10 janvier 2007
 Purpose

Here is a text item's PJC that can be used in multi-records Forms tables.

     Multi-record PJC textfield

It allows to have a coherent behaviour in a multi-record table for items that record number are greater than the number of records displayed.

In the standard way, you can set an Implementation Class to a PJC that extends the corresponding Forms item type (VTextField in this example), but you cannot use the Set_Custom_Property() built-in on a record number greater than the number of records displayed block's property.
For instance, it this property is set to 10 (ten records displayed by the block), the following instruction will raise an error:

Set_Custom_Property( 'BL.TEXT_ITEM', 11, 'SET_PROPERTY', '...' );

This is a problem because you cannot use a PJC on a multi-record block if the number of records fetched or created is greater than then number of records displayed.

This PJC can be used in this case because it holds a table of objects for each PJC's instance.
You can use it to give each record  a special color (without having to use the Set_Item_Instance_Property() built-in with tens of visual attributes), or also have one different hint and tooltip for each record (which is not possible in standard).

How it works:

Within the PJC:

each PJC's instance (10 in this example) can handle 0 to n physical records.
You can see, on the screenshot above that the first line displays the record #9. If you scroll the block, it would display the 10th, then the 11th, and so on.
So, each PJC instance hold a table of objects. Each physical record must have a corresponding object in this table.

In this sample, each object contains the following values:


   . tooltip
   . hint
   . background color
   . foreground color
   . int value
   . float value
   . string value



Within the Forms module:

The trick is to re-draw all the displayed items (the page set) with their corresponding values.
This job is done in the When-New-Item-Instance block-level trigger:

Declare
  LN$Pos pls_integer ;
  LN$Max pls_integer := Get_Block_Property( :system.current_block, RECORDS_DISPLAYED) ;
  LN$Top pls_integer := get_block_property( :system.current_block, TOP_RECORD) ;
Begin 

---------------------------------------------------
-- Calculate the cursor position in the page set --
-- cannot be greater than the number             --
-- of records displayed                          --
---------------------------------------------------

If LN$Top > 1 Then 
  LN$Pos := :system.cursor_record - LN$Top + 1 ;
Else
  LN$Pos := :system.cursor_record ;
End if;

--------------------------------
-- Handle the graphic aspects --
-- for the entire page set    --
--------------------------------

For i In 0 .. LN$Max-1 Loop
  Set_Custom_Property('BL.TXT', i+1, 'PAINT_RECORD', to_char(LN$Top+i) );
End loop ;

End;




The Java code

     MultiTextField.java      MultiProps.java



The implementation class of the Text Item

     oracle.forms.fd.MultiTextField


The methods you can call

 

  • Add a new record object

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_NEW_REC', 'num_record' ) ;


  • Set the Foreground color

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_FGCOLOR', 'num_rec,r,g,b' ) ; 


  • Set the Background color

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_BGCOLOR', 'num_rec,r,g,b' ) ; 


  • Set the hint

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_HINT', 'num_rec,hint_text' ) ; 


  • Set the tooltip

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_TOOLTIP', 'num_rec,tooltip_text' ) ; 


  • Set a int value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_INT_VALUE', 'num_rec,int_value' ) ;


  • Set a float value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_FLOAT_VALUE', 'num_rec,float_value' ) ;


  • Set a char value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_CHAR_VALUE', 'num_rec,char_value' ) ;


  • Set the curent record indice

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_INDICE', 'physical_record_number' ) ;



The methods you can get

 

  • every property set

 

   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp_rec, 'GET_HINT' ) ;
      Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_TOOLTIP' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_INT_VALUE' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_FLOAT' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_CHAR' ) ;

The property is read for the physical record number indicated by the SET_INDICE property, so you have to set this property before.

e.g. : 

-------------------------------------------------
-- Get the hint of the current physical record --
-------------------------------------------------

Set_Custom_Property('BL.TXT', LN$Pos, 'SET_INDICE', to_char(:system.cursor_record) );
Message(Get_Custom_Property('BL.TXT', LN$Pos, 'GET_HINT' ));




The sample dialog

   . Download the pjcmultirec.zip file
   . Unzip the files
   . copy the multirecord.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the PJCMULTIREC.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module

Par Oracle Forms community
Ecrire un commentaire - Voir les 1 commentaires - Recommander
Mardi 13 mai 2008

Purpose

This PJC is a workaround to the issue defined in the bug 3867157 on Metalink.

It allows having the same behaviour on the Web that the one it has on the C/S version. The When-List-Changed trigger would fire only when the mouse is clicked or when the Enter key is pressed, but not when the end-user types a letter to filter the list.

It is a PJC so that you do not need any Bean Area. Just fill the Implementation Class of your existing List Item.



The Java code

     PopList.java



The implementation class of the List Item

     oracle.forms.fd.PopList


The methods you can set



SET_CASE_SENSITIVE

By default, the poplist is case sensitive, but you can set it not sensitive.

Set_Custom_Property( 'BL.BT', 1, 'SET_CASE_SENSITIVE','false');

 

 

  SET_LOG

Set_Custom_Property( 'BL.BT', 1, 'SET_LOG','true');




The sample dialog


     . Download the poplist.zip file
     . Unzip the file
     . copy the poplist.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file to add the poplist.jar to both archive and archive_jini tags.
     . Open the poplist.fmb module (Oracle Forms 9.0.2) the first List-Item uses the PJC, so that you can compare with the second that is a standard List-Item.
     . Compile all and run the module

Par Oracle Forms community
Ecrire un commentaire - Voir les 0 commentaires - Recommander
Créer un blog sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur - Signaler un abus - Articles les plus commentés