So they decide to go production with 4.2 whilst I’m on holiday.

Early reports from the front suggest that you can build an APEX app on a playbook but HTML 5 charts don’t work even if the browser is webkit based and supports svg, flash does work though.

More information to follow, but not soon. Tomorrow we are promised an off shore wind and a 10 ft swell, should be gnarly dude (I know, but if I talk like that it really gets under the skin of real surfers and that makes me smile. I am a bad person)


I was holding on to the hope that the oracle cloud couldn’t go live without 4.2, and the APEX listener 2 being production.

Looks like I was wrong. Again.I hate it when that happens.

Dimitri you’ve broken my heart


The first thing I do each day is check the blogs and apex.oracle.com to see if 4.2 has gone production.

Is there a support group?


A (very) quick post on how to get a button, other than the listed graphics in your link column.

Look in the css associated with your theme. Find a button related CSS class eg. t20Button and in the link attributes property add class=t20Button.

Hopefully I’ll remember how I did that now.


If like me you are using APEX with an Oracle Application Server acting as your web server you might be tempted not to install web cache and keep things simple. That would be a mistake. Don’t do it, no really don’t.

Someone who shall remain nameless decide to set up our production APEX install without web cache. It was slow, really really slow. I’m sure I could have achieved what web cache achieves by playing with the Apache parameters but 2 minutes to activate web cache did the job.


Problem

The APEX spell checker is rubbish. Many people are stuck with IE6/7 at work, these browsers don’t come with a built in spell checker and the one provided with Apex 3.2 is horrible.

A default APEX install has no dictionary, tables exist to hold one but they are empty. If you are rash enough to populate the dictionary tables you will discover that it’s quite good at spotting spelling mistakes but it only appears to do a soundex to find suggestions and those suggestions come in alphabetical order.  Not good, not good at all.

The APEX version 4 version at apex.oracle.com doesn’t seem to have an option for a spell checker on text areas at all. It is still mentioned in the help though. Are the APEX team going to solve this problem or are they just going to hide the problem child? Firefox and Google Chrome users get the facility from their browser so maybe they think a solution isn’t needed.

Solution

If you have been around the Oracle Forms development world you may have come across a tool called JSpell, a java based spell checker which can be integrated into Forms giving a spell checker for any text field.

Jspell comes in a variety of guises. From the Apex point of view there are two which interest us. The first is JspellHTML which is a spell checker that works like the current APEX one and calls a pop up spell checker at the press of a button. The second is Jspell Evolution (I think that should be said in film trailer voice over style). This is an AJAX check as you type spell checker, and gives one of those wiggly red lines under misspelt words.

Both can be installed into a Oracle Application Server 10.1.2 and used with APEX. Hurrah. They can also be installed into other Java apps servers and IIS but I leave that as an exercise for the reader.

Download the appropriate version from the Jspell website (Jspellhtmlj.zip) and un-zip it

JSpell HTML

Download the appropriate version from the Jspell website (Jspellhtmlj.zip) and un-zip it

I’ll be using the Enterprise Manager interface because its the easiest way of installing an Java app.

In a default OAS 10.1.2 install you will have an OC4J instance called home. Navigate to it.

Navigate to the Applications tab

Deploy the spell war file

Browse for the war file and select it.

Set application name to “jspellhtml”

Set map to URL to “/jspellhtml”

You now have a Jspell deployed to the apps server. You can test it by navigating to http://appservername/jspellhtml/test.html

Now we need to implement it in an Apex page.

First, define the fields that will be checked. We do this by adding some javascript to the HTML header in the page header. This registers the fields that will be checked, they are put into a JS array via the following code. You just need to modify it for your field names.

I have a default form based on the Dept table.

<script language="JavaScript" src="/jspellhtml/jspell.js"></script>

<script language="JavaScript"><!--

function getSpellCheckArray() {
 var fieldsToCheck=new Array();
 // make sure to enclose form/field object reference in quotes!
 fieldsToCheck[fieldsToCheck.length]='document.forms["wwvFlowForm"].P3_DNAME';
 fieldsToCheck[fieldsToCheck.length]='document.forms["wwvFlowForm"].P3_LOC';
 return fieldsToCheck;
}

var language;
//--></script>

Now you just need to create the button to call the spell check. Create a button that redirects to a URL containing this code.

javascript:jspellcheck();

Like this


You should now have a functioning APEX spell checker, assuming you speak Americanish. If you speak a sensible language, Hungarian for instance, then you will need to change the dictionary. Jspell will provide  alternative dictionaries as part of the license.

First off you need a dictionary from the nice people at jspell. Mine is “lex_enGB.jdx” copy that to the apps server \ORACLE_HOME\j2ee\home\applications\jspellhtml\jspellhtml\WEB-INF\jspell. If you are in the right place you will find “lex_enUS.jdx”. This is where your license key goes too.

Navigate to the “home” OC4J in the enterprise manage and restart it.

Now navigate up a couple of levels to \ORACLE_HOME\j2ee\home\applications\jspellhtml\jspellhtml. Here you will find the jspell.js file. Open it and set the “language” variable. E.g.


var language="English (GB)";

You can find the language syntax in the test.html file in the same directory.

JSpell evolution

Jspell Evolution is set up in the same way as JspellHTML. The difference is in the implentation inside APEX.

First the javascript added to the header is different. Note the line initiating JSPELL and the syntax for identifying the fields.

<script TYPE="text/javascript" SRC="/jspellEvolution/jspellSettings.js"  CHARSET="ISO-8859-1"></script>
<script TYPE="text/javascript" SRC="/jspellEvolution/jspellEvolution.js" CHARSET="ISO-8859-1"></script>

<script LANGUAGE="JavaScript" TYPE="text/javascript"> <!--

 window.onload=jspellInit;

 /*****************************************************/
 /* Implement this function to explicitly declare the */
 /* fields that you want to spell check.              */
 /*****************************************************/
 function getSpellCheckArray()
 {
 var fieldsToCheck=new Array();
 // Use DOM Element IDs to specify fields to spell check
 fieldsToCheck[fieldsToCheck.length]=[document,"P5_EFF_DETAILS"];
 fieldsToCheck[fieldsToCheck.length]=[document,"P5_EFF_ACTIVITY"];
 return fieldsToCheck;
 }

 //--> </script>

The problem is that Jspell evolution replaces the standard form elements with some of its own, so we need to re-sync Jspell’s items with the standard APEX ones. Fortunately Jspell provides the means to do this.

We need to change any buttons that do a “save”, adding some extra javascript in.

The following needs to changed for your submit/save button;

And for your “create” button.

I’ve tested Jspell evolution and it appears to work and re-syncs as expected but I’m going with the HTML version in production.

Links




  • 2,626 hits
Follow

Get every new post delivered to your Inbox.