23-04-2021



New in v1.2.0: Icon fonts, social icons, and media icons! Bootstrap Icons. Free, high quality, open source icon library with nearly 1,200 icons. Include them anyway you like—SVGs, SVG sprite, or web fonts. Download 5,566 login icons. Available in PNG and SVG formats. Ready to be used in web design, mobile apps and presentations. Form Icons - Download 30 Free Form icons @ IconArchive. Search more than 600,000 icons for Web & Desktop here.

This section explains how to specify the default location and search paths for icons and images in Registry.dat.

4.9.1 Managing Registry.dat with Application Server Control

Use Application Server Control to change, add, or delete parameters from Registry.dat.

To change a Registry.dat parameter value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. Select a radio button next to a parameter and change the value(s) for it in the Value text field.

  4. Click Apply.

    Your changes are saved.

To add a Registry.dat parameter and its value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. At the bottom of the Registry.dat page, enter a name for the parameter in the Name text field.

  4. Enter a value for this new parameter in the Value text field.

  5. Click Add New Parameter.

    Your changes are saved.

To delete a Registry.dat parameter and its value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. Select a radio button next to a parameter and click Delete.

  4. The Confirmation page appears, click Yes.

  5. The parameter is deleted and the Configuration page reappears.

4.9.2 Deploying Application Icons

When deploying an Oracle Forms application, the icon files used must be in a Web-enabled format, such as JPG or GIF (GIF is the default format).

By default, the icons are found relative to the DocumentBase directory. That is, DocumentBase looks for images in the directory relative to the base directory of the application start HTML file. As the start HTML file is dynamically rendered by the Forms Servlet, the forms directory becomes the document base.

For example, if an application defines the icon location for a button with myapp/<iconname>, then the icon is looked up in the directory forms/myapp.

To change the default location, set the imageBase parameter to codebase in the Forms Web Configuration page of Enterprise Manager Application Server Control Console. Alternatively, you can change the default.icons.iconpath value of the Registry.dat file in the forms/java/oracle/forms/registry directory.

Setting the imageBase parameter to codebase enables Oracle Forms to search the forms/java directory for the icon files. Use this setting if your images are stored in a Java archive file. Changing the image location in the Registry.dat configuration file is useful if you want to store images in a central location independent of any application and independent of the Oracle Forms installation.

4.9.2.1 Storing Icons in a Java Archive File

If an application uses a lot of custom icon images, it is recommended you store icons in a Java archive file and set the imageBase value to codebase. The icon files can be zipped to a Java archive via the Jar command of any Java Software Development Kit (Java SDK).

For example, the command jar -cvf myico.jar *.gif packages all files with the extension .gif into an archive file with the name myico.jar.

In order for Oracle Forms to access the icon files stored in this archive, the archive needs to be stored into the forms/java directory. Also, the name of the archive file must be part of the archive tag used in the custom application section of the formsweb.cfg file (for example, archive_jini=frmall_jinit.jar, myico.jar). Now, when the initial application starts, the icon files are downloaded to and permanently stored on the client until the archive file is changed.


Note:

You do not need to deploy Oracle Forms default icons (for example, icons present in the default smart icon bar), as they are part of the frmall.jar file.

4.9.2.2 Adding Icon Changes to Registry.dat

If you want to add icon changes to the Registry.dat file used by your application, it is recommended that you make a copy of the existing Registry.dat file and edit the copied file.

To create a copy of the Registry.dat file:

  1. Copy the Registry.dat text file found in the ORACLE_HOME/forms/java/oracle/forms/registry directory to another directory. This directory must be mapped to a virtual directory for your Web server (for example, /appfile).

  2. Rename this new file (for example, myapp.dat).

  3. Modify the iconpath parameter specifying your icon location:

    (for an absolute path)

    or

    (for a relative path, starting from the DocumentBase Directory)

  4. Modify the iconextension parameter:

    or

To reference the application file:

  • In a specific named configuration section in the formsweb.cfg file, modify the value of the serverApp parameter and set the value to the location and name of your application file.

    For example:

    (for an absolute path)

    or

    (for a relative path, relative to the CodeBase directory)

    Table 4-12, 'Icon Location Guide' describes the correct locations where to place your application icons:

Table 4-12 Icon Location Guide

Icon LocationWhenHow

DocumentBase

Default. Applications with few or no custom icons.

Store icons in forms directory or in a directory relative to forms.

Java Archives

Applications that use many custom icons

Set ImageBase to codebase, create Java archive file for icons, and add archive file to the archive parameter in formsweb.cfg.

Registry.dat

Applications with custom icons that are stored in a different location as the Oracle Forms install (can be another server).

Useful if you need to make other changes to the Registry.dat file like font mapping.

Copy Registry.dat and change ServerApp parameter in formsweb.cfg.


4.9.3 SplashScreen and Background Images

When you deploy your applications, you have the ability to specify a splash screen image (displayed during the connection) and a background image file.

Those images are defined in the HTML file or you can use the Forms Web Configuration page in Enterprise Manager:

The default location for the splash screen and background image files is in the DocumentBase directory containing the baseHTML file.

4.9.4 Custom Jar Files Containing Icons and Images

Each time you use an icon or an image (for a splash screen or background), an HTTP request is sent to the Web server. To reduce the HTTP round-trips between the client and the server, you have the ability to store your icons and images in a Java archive (Jar) file. Using this technique, only one HTTP round-trip is necessary to download the Jar file.

4.9.4.1 Creating a Jar File for Images

The Java SDK comes with an executable called jar. This utility enables you to store files inside a Java archive. For more information, see .

For example:

This command stores three files (Splash.gif, Back.gif, icon1.gif) in a single Jar file called myico.jar.

4.9.4.2 Using Files Within the Jar File

The default search path for the icons and images is relative to the DocumentBase. However, when you want to use a Jar file to store those files, the search path must be relative to the CodeBase directory, the directory which contains the Java applet.

If you want to use a Jar file to store icons and images, you must specify that the search path is relative to CodeBase using the imageBase parameter in the formsweb.cfg file or HTML file.

This parameter accepts two different values:

  • DocumentBase The search path is relative to the DocumentBase directory. It is the default behavior.

  • CodeBase The search path is relative to the CodeBase directory, which gives the ability to use Jar files.

In this example, we use a JAR file containing the icons and we specify that the search should be relative to CodeBase. If the parameter imageBase is not set, the search is relative to DocumentBase and the icons are not retrieved from the Jar file.

For example (formsweb.cfg):

4.9.5 Search Path for Icons and Images

The icons and images search path depends on:

  • What you specify in your custom application file (for the icons).

  • What you specified in the splashScreen and background parameters of your default Forms Web configuration or HTML file (for the images).

  • What you specify in the imageBase parameter in the Forms Web Configuration page of Application Server Control for the file or HTML file (for both icons and images).

Forms Services searches for the icons depending on what you specify. This example assumes:

  • host is the computer name.

  • DocumentBase is the URL pointing to the HTML file.

  • CodeBase is the URL pointing to the location of the starting class file (as specified in the formsweb.cfg file or HTML file).

  • mydir is the URL pointing to your icons or images directory.

4.9.5.1 DocumentBase

The default search paths for icons and images are relative to the DocumentBase. In this case, you do not need to specify the imageBase parameter:

Table 4-13 Search Paths for Icons

Location SpecifiedSearch path used by Forms Services

default

http://host/documentbase

iconpath=mydir

(specified in your application file)

http://host/documentbase/mydir

(relative path)

iconpath=/mydir

(specified in your application file)

http://host/mydir

(absolute path)


Table 4-14 Search Paths for Images

Forms Icon Blue

Location SpecifiedSearch path used by Forms Services

file.gif (specified, for example, in formsweb.cfg as splashscreen=file.cfg)

http://host/documentbase/file.gif

mydir/file.gif

http://host/documentbase/mydir/file.gif

(relative path)

/mydir/file.gif

http://host/mydir/file.gif

(absolute path)


4.9.5.2 CodeBase

Use the imageBase=CodeBase parameter to enable the search of the icons (Table 4-15) and images (Table 4-16) in a Jar file:

Table 4-15 Icon Search Paths Used by Forms Services

Location SpecifiedSearch Path Used by Forms Services

default

http://host/codebase or root of the Jar file

iconpath=mydir

(specified in your application file)

http://host/codebase/mydir or in the mydir directory in the Jar file

(relative path)

iconpath=/mydir

(specified in your application file)

http://host/mydir

(absolute path)

No Jar file is used


Table 4-16 Image Search Paths Used by Forms Services

Location SpecifiedSearch Path Used by Forms Services

file.gif

http://host/codebase/file.gif or root of the Jar file

mydir/file.gif

(specified in your HTML file)

http://host/codebase/mydir/file.gif or in the mydir directory in the Jar file

(relative path)

/mydir/file.gif

(specified in your HTML file)

http://host/mydir/file.gif

(absolute path)

No Jar file is used.


Would you like to add icons within your forms? Icons can be a great way to visually reinforce the purpose of a field, and can help your forms look more customized.

Forms Icon White

In this tutorial, we’ll discuss how to add icons from Font Awesome to your forms. Font Awesome is a great option because their icons act like a font, meaning that they will adopt the same color and sizing as the other fonts on your site.

Here are the topics we’ll cover in this tutorial:

  • Displaying Icons in:

Adding Font Awesome to Your Site

The first step is to add Font Awesome’s icon library to your site. This can be done in many ways, from adding code to your site’s header to installing a plugin. For details on each option, check out WPBeginner’s guide to adding icon fonts.

Forms Icon

To keep things simple, we’ll use the plugin method with Better Font Awesome.

Better Font Awesome is a free WordPress plugin that adds the resources needed to use Font Awesome icons on your site. When you’re ready, go ahead and install this plugin.

Once this plugin is installed and activated, you’re ready to start adding icons to your forms!

Finding an Icon on Font Awesome

Now that we have the ability to use Font Awesome on our site, let’s check out how to grab information for the icon you want in your form.

Any icon from Font Awesome’s icon library will work in the same way, but for this example we’ll use their paper airplane icon.

Note: Font Awesome offers both free and paid icons. You can use the left menu on their site to easily filter icons. Or click this link to only view free icons.

Once the icon page is open, we need the unicode value. This is displayed just below the icon name. The unicode for this paper airplane icon is f1d8.

Displaying Icons In Front of Form Titles

To add an icon in front of our form’s title, we need to create some custom CSS that will insert this icon for us. This CSS will be a little different depending on whether you want the icon to appear in front of the title of all WPForms on your site, or just this one form.

Add Icon to All Form Titles

The CSS to display an icon in front of all form titles is simple because it can be more general. Here’s the CSS you’ll need:

Note: For details on adding custom CSS to your site, please check out WPBeginner’s tutorial step by step guide.

If you check out the first line, with content, you’ll notice that the unicode is included after a backslash (). This value can be replaced with the unicode for any other icon in Font Awesome’s library.

This CSS also includes a right margin of 10 pixels. Without this, there would be no gap between the icon and the form’s title. This number can be changed however you’d like.

Add Icon to a Specific Form’s Title

Instead of adding the same icon to the titles of every form on your site, you can use more specific CSS to target only one specific form.

To target a single form, you’ll need to find the unique ID number for your form. You can locate this by looking at the shortcode used to embed your form, or by opening WPForms » All Forms. The ID number for each form is shown within the shortcode.

We will use this ID number, 31, to make our CSS more specific. Here’s the CSS that will only add an icon in front of the title of this single form:

This CSS is almost exactly the same as the style that will change all forms on your site. The only difference is that we added #wpforms-31, so now this style will apply only within this one form.

For your own form, you’ll just need to change the form ID number and replace the unicode for the icon you want, as described in the section above.

Displaying Icons In Front of Field Labels

Displaying an icon in front of all field labels requires very similar CSS to what was described above for form titles:

Target A Single Field’s Label

You may not want the same icon to appear next to every field. To target only a single field, we’ll need to make our CSS more specific by locating the unique ID for the field.

This approach is very similar to targeting a single form’s title, described above.

First, you’ll need to right click on the field you’d like to target and choose Inspect.

Now your screen should split to show HTML from the page. Make sure the entire field you want to target is highlighted (including the label and input box), then look for the ID.

For this field, the ID is wpforms-245-field_1-container. Here’s how we’d make the icon label CSS specific only to this single field:

If you check out that first line of the CSS, you’ll notice that we added a ‘#’, followed by the ID we just found. Now our icon will only be added to this single field, without altering any other field labels (in this form or any other form).

Displaying Icons In HTML Fields

Adding icons to HTML fields is the simplest option, and requires no custom CSS.

All you’ll need is to add some simple shortcode within the HTML field. As an example, here’s the shortcode we’d need for the paper airplane icon:

To adjust this for a different icon, you’d just need to copy the name from the specific icon’s page in Font Awesome. The icon name will be in large text near the top of the page.

Then, you’d replace paper-plane in the shortcode with the name of the icon you want to use.

In an HTML field, you can also add additional text and/or HTML around the icon shortcode if you’d like.

That’s it! You can now add icons to multiple places in your forms, and even target only specific forms or fields to add an icon.

Forms Icon Png

Would you like to style your forms even further? Check out our article on Beautiful Contact Form Designs You Can Steal (this includes how to add an icon to your Submit button).