Purpose
This bean allows to display buttons with a html content.
The content can be text or image.
On the screenshot below, we can see a button with an image that comes from an internet url
(<img src="http://....">)
The java code
package oracle.forms.fd; import java.awt.*; import java.util.StringTokenizer; public class HtmlButton extends VBean implements ActionListener } |
Forms configuration
- Copy the htmlbutton.jar file in the /forms/java directory
- Sign the htmlbutton.jar file with your own certificate
- Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jinit variable
Implementation Class property
oracle.forms.fd.HtmlButton
Properties that can be set
The background color of the button
Set_Custom_Property( 'BLOC3.BEAN_ITEM',1, 'SETBACKGROUND','rgb_color' ) ;
The label
Set_Custom_Property( ‘BLOCK.BEAN_ITEM’, ‘SETLABEL’, ‘the_label’ ) ;
The sample dialog
- Download the htmlbutton.zip file
- Unzip the htmlbutton.zip file
- Copy the htmlbutton.jar file in your /forms/java/ directory
- Edit your /forms/server/formsweb.cfg file
- Open the HTML_BUTTON.fmb module (Oracle Forms 9.0.2)
- Compile all and run the module
The code that set the button properies is located in the When-New-Form-Instance trigger
------------------- -- Text button -- ------------------- -- Set the background color -- Set_Custom_Property( 'BLOC3.BEAN',1, 'SETBACKGROUND','143,161,253' ) ; -- Set the label -- LC$ButLabel := '<html><center>' || '<font size=5 color=#ff0000>Co<font size=5 color=#00ff00>lo<font size=5 color=#0000ff>red</u></b></font>' || '<br><font size=3 color=#ffff00><b>HTML B</b><i>utton</i></font>' ; Set_Custom_Property( 'BLOC3.BEAN',1, 'SETLABEL', LC$ButLabel ) ; -------------------- -- Image button -- -------------------- -- Set the background color -- Set_Custom_Property( 'BLOC3.BEAN2',1, 'SETBACKGROUND','255,255,255' ) ; LC$ButLabel := '<html><table border="1"><tr><td align="center" valign="center"><img src="http://fdtool.free.fr/forms-pjc-bean/tmp/will.jpg" height="80" width="80" align="middle"></td></tr></table>' ; Set_Custom_Property( 'BLOC3.BEAN2',1, 'SETLABEL', LC$ButLabel ) ; |