Inside Oracle APEX by Patrick Wolf

I got quoted

Hey, I got quoted in the official Oracle APEX 3.0 press release!
Am I now getting famous and have to watch out for paparazzi?

You will find my quote in the Sphinx IT Consulting section in the Oracle APEX 3.0 press release.

« ... Read full posting ... »

Slightly different behavior of $x in Oracle APEX 3.0

Just noticed a slightly different behavior of $x in Oracle APEX 3.0.

Probably many of you just use it to pass the id-string of an element (eg. $x("P4_TEST")) to this function to get the object of this field/div/... id, but you can also call it with an object and in that case the function will just return the object which has been passed in.

You may ask when do you need that? You need it if you write more generic JavaScript code where you have for example a function with the following example code
function getWhatEver(pField)
{
var vField = $x(pField);
// do what ever we want with vField
};

If the caller has already the field object, then he just can pass it in and the function doesn't have to do another lookup for the field
getWhatEver(vFieldVariable);
If the caller doesn't have one, he can still call it with the id string
getWhatEver("P4_TEST");
and the $x function will do the necessary lookup.

The above described behavior still works for objects of node type 1 (Node.ELEMENTNODE), but with Oracle APEX 3.0 it doesn't work if you pass in for example the window object, in that case the $x function will return false.

I had a function which can add/register events (eg. onkeypress, ...) to each object, but in APEX 3.0 it failed when called with the window object.

So just be aware of this changed behavior!

Labels: , , ,


« ... Read full posting ... »

Three new interesting postings

If you haven't subscribed to all Oracle APEX blogs which are out there, I want to bring your attention to the following three postings which I think are of general interest.
Just to keep you updated :-)

Labels: , , , , ,


« ... Read full posting ... »

Which Tabular Form Column is mapped to which Apex_Application.g_fxx array?

Have you ever asked yourself how Oracle APEX maps the columns of a Tabular Form to the Apex_Application.g_fxx (alias Htmldb_Application.g_fxx, alias WWV_Flow.g_fxx) array?

I think most developers use one of the following methods to get the correct mapping:
  • Look at the generated HTML output of the page and get the name attribute of the INPUT element
  • Use eg. Firebird to inspect the column field and get again the value set for the name attribute.
But did you know that the algorithm which APEX is using is quite simple?

APEX takes your Tabular Form select statement and based on the order in which the columns are appearing in the select statement (not in the order you see on the Report Attributes tab!) it starts mapping
  1. if the column is a "Saves state" column, that means it is rendered as HTML field and
  2. if the condition/authorization matches
it will increase the field counter.

Note: If you have a row selector, this column will always map to g_f01

Example:

SELECT EMPNO, EMPNO AS EMPNO_DISPLAY, FIRST_NAME, LAST_NAME, HIRE_DATE FROM EMP

Let's assume that all fields except of EMPNO_DISPLAY are rendered as fields and LAST_NAME has a condition which isn't TRUE.

EMPNO = g_f01
EMPNO_DISPLAY = not mapped
FIRST_NAME = g_f02
LAST_NAME = not mapped because of condition
HIRE_DATE = g_f03

In the case if we have a Row Selector.

Row-Selector = g_f01
EMPNO = g_f02
EMPNO_DISPLAY = not mapped
FIRST_NAME = g_f03
LAST_NAME = not mapped because of condition
HIRE_DATE = g_f04

If you don't want to hassle around with that mapping, where you also have to consider the conditions/authorizations, ..., you may should take a look at the Plug & Play Tabular Form Handling of the ApexLib Framework.

Labels: , , ,


« ... Read full posting ... »

ApexLib release 1.5 available

Enhancements to the APEX repository views in Oracle APEX 3.0 made it possible to remove some existing restrictions of the ApexLib framework.
  • The Page Flow Diagram Generator works now in the Application Schema, too. So you don't have to grant the APEX tables anymore if you want to use this feature.
  • A Report Column Heading which is not "Custom", will now also be supported.
  • This release also contains a fix for a not so well performing view in combination with APEX 3.0.
  • If you use the V function drop-in, please check the Change Log for upgrade instructions!
I have also created a new "Feature Restriction" section in the HowToInstall document, which describes the different restrictions based on the used APEX version and the installation option. The new "Upgrade an existing version of ApexLib" section describes the necessary steps if you have an existing version.

Note: The above changes do not mean that the ApexLib Framework doesn't work with pre-APEX 3.0 versions anymore. The current supported versions are 2.0, 2.1, 2.2 and 3.0.

Get the new release now!

Change Log:
  • CR# 1683243: Page Flow Diagram Generator should work with repository views
  • CR# 1683306: Support for other Report Column Headings then "Custom"
  • Bug# 1663904: Placeholders in user defined messages are not replaced
  • Bug# 1679309: Error in ApexLib_Item if $APEXLIB_IGNORE_VALIDATION$ is set
  • Bug# 1680244: View APEXLIB_V_PAGE_ITEM very slow with APEX 3.0
  • Bug# 1680250: Update the patched V and NV functions to APEX 3.0

Labels: , ,


« ... Read full posting ... »

Oracle APEX 3.0 available for download!

Oracle APEX 3.0 is finally available for download!

The downloaded APEX version is 3.0.0.00.20, so they fixed some of the late minutes issues reported on the OTN forum.

They also renovated the Oracle APEX homepage on OTN, it's much nicer now and offers a better overview.

And don't forget to read all the details about the new features.

Labels: ,


« ... Read full posting ... »

XML processing in the database

A few days ago I came across an interesting posting on the AMIS blog about an XML(DB) presentation at the OOP 2007 conference.

The presentation done by Ken Atkins is also available online and is really worth reading it. It gives a comprehensive overview (with lot of examples) of the built-in XML processing features of the Oracle database.

So if you ever have the requirement to parse an XML file or export your relational stored data as an XML file, you don't have to use Java or any other language on the Application Server to do that job. You can easily do it directly in the database / Oracle APEX. And I'm quite sure it will be much faster than doing it outside of the database. BTW, I used some of the XML processing features recently in my first OTN article about Integrating Yahoo Pipes into an Oracle APEX Application

Download the presentation:

Labels: ,


« ... Read full posting ... »

What are the Apex Evangelists?

No it's not a new religious sect praying to god "APEX" :-) BTW, aren't we already praying to god "Larry"? One god is enough! ;-)

The Apex Evangelists are a group of Oracle APEX experts, founded by Dimitri Gielis and John Scott. The other members are Dietmar Aust, Denes Kubicek and myself.

Got curios what we do? Then take a look at our new web-site http://www.apex-evangelists.com/

Labels: , ,


« ... Read full posting ... »

New Oracle APEX 3.0 online on apex.oracle.com!

My guessing that the longer maintenance window is used to install the new Oracle APEX 3.0 on apex.oracle.com was not so wrong :-)

When you logon now, you will see that they have installed 3.0.0.00.18 on the regular apex.oracle.com trial environment and I'm sure the download will follow in the next days.

Congratulation to the APEX development team for the great job!!!

Labels: ,


« ... Read full posting ... »

Seamless integration of ApexLib into the APEX Builder IDE

One of the "drawbacks" of using the ApexLib Framework is, that you have to remember all the "ApexLib Hints" which you have to use to configure the runtime behavior of the framework.

Ok, after some time you are getting used to them, but still, wouldn't it be much more comfortable to set this properties as you do it for the APEX properties?

With the new version of the APEX Builder Plugin you are now able to do that!

On the APEX Builder Pages "Edit Page Item", "Edit Region - Region Definition" and "Report Attributes > Column Attributes" you now have a new section "ApexLib Framework" with the possible properties in that context.

Try it out and download the new version!



Labels: , , , ,


« ... Read full posting ... »

Oracle APEX 3.0 released in the coming week?

Is the coming week the release date for the upcoming Oracle APEX 3.0?

If you go to apex.oracle.com you will see the following message

Quite a long "maintenance" window, isn't it? If you combine that with the recent developer comments in the APEX 3.0 feedback application, someone could guess that they are applying the new release to apex.oracle.com during that maintenance window...

But hey, it's just a guess :-) What do you think, will we see it next week?

Labels: ,


« ... Read full posting ... »

My first OTN article

Just saw that the Oracle APEX team has updated the Oracle APEX community page on OTN.

And...
*drum roll*
they have included my first OTN article!!! :-)

Labels: , ,


« ... Read full posting ... »

Min-/Max Value Validation in the Browser

How often have you already created an APEX validation to make sure that a money amount is greater or egal to 0.00, a percentage value is between 0 and 100 or that an entered date is less or equal to today?

There is some work involved doing that.
  1. You have to create a validation to make sure that the entered value is numeric.
  2. Create another validation which only fires if the previous one returned OK.
  3. Enter the check as PL/SQL expression or SQL Expression
  4. Think about a good error message
All that just to check that the amount is greater or equal to 0... Another drawback is that the user only gets this error message when he submits the page, so if you want to give him immediate feedback in the browser you have to do the same checks with JavaScript...

Hmmm, there has to be an easier and faster way to do that.

There is! :-)

I added a declarative range check for Page Items/Tabular Form Columns in the recent release of the ApexLib Framework.

You can try it on my Feature demonstration web-site.

It's now possible to define the min-/max value for a field/column. This boundaries are checked immediately in the browser when you leave the field and for security reasons the same check is also done when you submit your page to the server.

You just have to put the ApexLib hints $APEXLIB_MIN_VALUE=min value$ and/or $APEXLIB_MAX_VALUE=max value$ into the Page Item comment or Link Attributes of Tabular Form Columns as you already do for other ApexLib hints.

What's supported?

You can assign fixed values. Eg. $APEXLIB_MIN_VALUE=0$ $APEXLIB_MAX_VALUE=100$ to do a range check or use $APEXLIB_MIN_VALUE=01-JAN-2007$ to check against a fixed date.

But you can also make it more dynamic and reference other Application Items/Page Items. Eg. $APEXLIB_MAX_VALUE=&F111_TODAY.$ to check that the user doesn't enter a date which is greater than today.

For Tabular Form Columns you can also use the #COLUMN_NAME# notation to reference a column cell value of the same row. Eg. $APEXLIB_MIN_VALUE=#SALARY#$

If you reference a page item/column on the current page, the min/max value changes when you modify the referenced field.

Note: The values specified, independent if they are fixed or dynamic have to comply to the format mask of the current item/column!!! That means, if your current date picker has DD-MON-YYYY as format mask, the fixed or referenced dynamic value also has to be of that format!

For our above example with the application item F111_TODAY, the corresponding initialization code would be a PL/SQL expression with the following code (we assume the used format mask is DD-MON-YYYY)
TO_CHAR(SYSDATE, 'DD-MON-YYYY');

What doesn't work (yet)?

It's not possible to enter an expression. For example to reference another field and add 1 day. eg. $APEXLIB_MIN_VALUE=&P4_VALID_FROM.+1$

But I think it's a good start for now and can save some development work!

BTW, I have also update the "Set" configuration for the ApexLib hints in the case you are using the APEX Builder Plugin. You can find the files in the "BuilderPlugin" directory.

Labels: , , ,


« ... Read full posting ... »

ApexLib release 1.4 available

Just uploaded a new release of the Oracle APEX development framework ApexLib onto Sourceforge.

As you can see from the change log, this release contains a lot of bug fixes, but it also includes a new feature. Declarative Min-/Max Value Validation in the Browser. More about that later.

There where also some requests to include the Feature Demonstration application into the distribution. Here you go! You will find it in the "Examples" directory.

Download the new release!

List of changes:
  • CR# 1673663: Min/Max value check
  • CR# 1670687: Use new jQuery 1.1.2 version
  • CR# 1674427: Include Feature Demonstration application
  • Bug# 1663904: JavaScript error if cascading lov field isn't rendered
  • Bug# 1666334: Cascading lov doesn't work for items on page 0
  • Bug# 1667049: Browser validation fails for format FM999G999G990D00
  • Bug# 1666860: cascading lov not working when bind variables are used twice
  • Bug# 1667490: Cascading lov raises javascript error on IE
  • Bug# 1669345: Max Length feature for TabForms isn't checked in IE
  • Bug# 1670168: Index NULL error if region name isn't unique
  • Bug# 1670770: Userdefined onBlur/onChange events have a wrong "this"
  • Bug# 1671284: The server side validation checks required for hidden items
  • Bug# 1666408: Wrong tabular form column validated in some cases
  • Bug# 1671956: Code in body onload isn't executed

Labels: , ,


« ... Read full posting ... »