« Internet Explorer 7 Support | Main | How To Delete An Entire Workspace Or Project? »

Buttons Generated As Standard Html Buttons In ADF Faces On Linux


Problem

This question comes regularly in the OTN forums.

You have developed your application on a Windows system and defined your own skin (css), including some customizations for the buttons f.ex.:
.AFButtonServerText:alias
{
    color:black;
    background-color: #D2DEED;
    font-weight:bold;
    font-family: Arial, Helvetica;
    font-size: 11px;
}

.AFButtonServerTextDisabled:alias
{
    color:#AAAAAA;
    font-family:Arial, Helvetica;
    font-size: 11px;
    font-weight: normal;
}

When you run the application in the Embedded OC4J on Windows, the page renders correctly, with the buttons generated as "image buttons":
ADFButton:

However, the same application deployed on iAS on your Linux machine shows the buttons as standard HTML buttons:
StandardButton: .

You use the following Java Option in iAS on Linux:
   -Djava.awt.headless=true
as recommended in the JDeveloper online help, "About ADF Faces Supported Platforms".

So, what's the problem ?

Cause

The font "Arial" is not available on your Operating System.

The ADF Faces buttons are normally generated as GIF files by the Java's AWT graphics library.
When the Java API doesn't have access to the specified font, it generates the button as a standard HTML button.

Solution

Either install the missing font on your Linux system (the Java API will use it to generate the image buttons) or use another font.

The best choice to avoid the problem when deploying the application on different platform is to specify a logical font (Dialog, SansSerif, ...), that's mapped to an existing physical font on your OS.
You can find the list of the mapping in <iAS_Home>\jdk\jre\lib\font.properties
NB: this name may differ depending on the OS

F.ex. the "SansSerif" logical font is mapped to the "Lucida Sans" physical font:
sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
and the Lucida font is always installed as part of the JDK (in ...\jre\lib\fonts).
So you are sure with this solution that the buttons will always be generated as image buttons, whatever the OS you are deploying to.


NB: though it was written for UIX, most of the information contained in the chapter "18. Image Generation in ADF UIX" of the "Oracle ADF UIX Developer's Guide" is still valid for ADF Faces.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on June 9, 2008 8:27 PM.

The previous post in this blog was Internet Explorer 7 Support.

The next post in this blog is How To Delete An Entire Workspace Or Project?.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle