Overblog Tous les blogs Top blogs Technologie & Science Tous les blogs Technologie & Science
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU

This is a bunch of tips and techniques related to Oracle PL/SQL and Forms.

Publicité

An open-file dialog box with image preview

Purpose

When you want to load images from the client machine to the database, you would like
to choose the right image file with a preview of each image.

This is a Javabean component that allows to display a JfileChooser dialog box with image preview.
It also allows to display at the same time different file types.



ImageFileChooser

The java code


Get the complete code here


Forms configuration

  • Copy the GetImageFileName.jar file in the /forms/java directory
  • Sign the GetImageFileName.jar file with your own certificate
  • Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jinit variable
archive_jini=f90all_jinit.jar,……,GetImageFileName.jar


Registring the bean

- Open the form
- Add a javabean component to any block
- Register the bean (be sure that it is not in a When-New-Form-Instance trigger, or use a timer)

 



FBean.Register_Bean('BLOCK.BEAN_ITEM',1,'oracle.forms.fd.GetImageFileName');

 

 


Invoke the bean's GetFile() function


image_file_name := FBean.Invoke_char('BLOCK.BEAN_ITEM',1,'GetFile','"Dialog box title","start directory"');

 e.g.


 

 

 :BL1.File := FBean.Invoke_char('BL1.IMAGEPICKER',1,'GetFile','"Select an image file name","M:\"');


The sample dialog

  • Download the imagefilechooser.zip file
  • Unzip the imagefilechooser.zip file
  • Copy the imagefilechooser.jar file in your /forms/java/ directory
  • Edit your /forms/server/formsweb.cfg file
  • Open the IMAGEFILECHOOSER.fmb module (Oracle Forms 9.0.2)
  • Compile all and run the module

     
Publicité
Retour à l'accueil
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article
L
<br /> <br /> How do I work the Cancel button.<br /> <br /> <br /> If I hit cancel button the :BL1.FIC is never null<br /> <br /> <br /> <br />
Répondre
O
<br /> <br /> so what is the content?<br /> <br /> <br /> <br />
Y
<br /> <br /> where do i paste the .java code ? thank you<br /> <br /> <br /> <br />
Répondre
O
<br /> <br /> Read the last paragraph to see how to configure and run the sample dialog.<br /> <br /> <br /> <br />
G
Help! I am have not been able to use "imagepicker" and "HandleImage" beans on the same form. Either one works or the other does not. I would like to select an image using imagepicker and display it using HandleImage. Forms10g Any Ideas? Thanks
Répondre