Sie sind auf Seite 1von 90

Oracle Handbooks

Apex 4.0
through the eyes of
Dimitri Gielis

ISBN: 978-1-906434-68-7
APEX 4.0

through the eyes of

Dimitri Gielis

Published 2011 by Simple-Talk Publishing

Cambridge, UK
Copyright Dimitri Gielis 2011

ISBN 978-1-906434-68-7

The right of Dimitri Gielis to be identified as the author of this work has been asserted by them in accordance
with the Copyright, Designs and Patents Act 1988.

All rights reserved. No part of this publication may be reproduced, stored or introduced into a retrieval
system, or transmitted, in any form, or by any means (electronic, mechanical, photocopying, recording or
otherwise) without the prior written consent of the publisher. Any person who does any unauthorized act in
relation to this publication may be liable to criminal prosecution and civil claims for damages.

This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, re-sold, hired
out, or otherwise circulated without the publisher's prior consent in any form other than which it is published
and without a similar condition including this condition being imposed on the subsequent publisher.

Cover Image by Andy Martin,

Table of Contents
About the Author .....................................................................................................5 
APEX 4.0: Highlights and video .............................................................................6 
APEX 4.0: Screenshots and first impression .........................................................12 
APEX 4.0: EA available...........................................................................................21 
APEX 4.0: Tree View vs Component View ............................................................22 
APEX 4.0: New public packages.............................................................................25 
APEX 4.0: Writing higher quality applications by using the Advisor ................28 
APEX 4.0: My thoughts after first round of playing ............................................31 
APEX 4.0: My first plugin – editable select list/combobox ..................................32 
APEX 4.0: Dynamic Actions Part 1 ........................................................................36 
APEX 4.0: Dynamic Actions Part 2 ........................................................................39 
APEX 4.0: EA2 – Websheets ...................................................................................45 
APEX 4.0: New features application and description ..........................................49 
Nice Search in APEX 4.0 .........................................................................................50 
APEX 4.0: EA3 available ........................................................................................51 
APEX 4.0 Websheets: Behind the scenes ...............................................................52 
Countdown to APEX 4 Public Release ..................................................................53 
CD APEX 4.0: Prepare application for upgrade ...................................................54 
CD APEX 4.0: Import APEX 3.2 app in 4.0 ..........................................................57 
CD APEX 4.0: Verifying imported application .....................................................61 
CD APEX 4.0: Utilities – upgrade application ......................................................64 
CD APEX 4.0: Feedback feature and team development ....................................67 
APEX 4.0: Into production .....................................................................................72 
Upgrade to APEX 4.0: Known issues – workarounds and patches .....................73 
APEX Patch 4.0.1 released ......................................................................................74 
Upgrading to APEX 4.0: jQuery.............................................................................75 
Upgrade to APEX 4.0: Tabular Forms ...................................................................76 
Upgrading to APEX 4.0: Templates .......................................................................79 
APEX 4.0: Application utilities ...............................................................................80 
APEX 4.0: Tree .........................................................................................................82 
APEX Patch 4.0.2 released ......................................................................................84 
Oracle Application Express (APEX) 4.1 and beyond ...........................................85 
Dimitri was born in 1978. Together with his family, he lives in Leuven, Belgium.
Already at an early age Dimitri started with computers (Apple II, IBM XT) and he
quickly knew he would like to work with computers and especially with databases all his
In 2000, Dimitri began his career working as a consultant for Oracle Belgium where he
got in touch with almost every Oracle product. His main expertise was in the database
area, but at that time he was also exposed to HTMLDB which was renamed Oracle
Application Express later on. From the very start he liked the Oracle database and APEX
so much he never stopped working with it. Dimitri then switched to another company to
create an Oracle team and do pre-sales, to later create and manage an Oracle Business
In 2007 Dimitri co-founded APEX Evangelists (,
together with John Scott. APEX Evangelists is a company which specializes in providing
training, development, and consulting specifically for the Oracle Application Express
On his blog ( he shares his thoughts and experience about
Oracle and especially Oracle Application Express.
Dimitri is a frequent presenter at OBUG Connect, IOUG Collaborate, ODTUG
Kaleidoscope, UKOUG conference and Oracle Open World. He likes to share his
experience and meet other people. He’s also President of the OBUG (Oracle Benelux
User Group) APEX SIG.
In 2008 Dimitri became an Oracle ACE Director. Oracle ACE Directors are known for
their strong credentials as Oracle community enthusiasts and advocates.
In 2009 Dimitri received the "APEX Developer of the year" award from Oracle
You can contact Dimitri at

Wednesday, August 05, 2009
If you didn't see the video or ppt of Mike Hichwa's APEX 4.0 presentation at ODTUG,
you should definitely have a look at it, so you know what is coming.
I decided to take notes during the video, to remember the highlights, and decided to share
them in this blog post. So here you go...

History of Oracle Application Express

I didn't know that Mike Hichwa was inspired by an ATM machine to create APEX.
Basically an ATM is very simple:

1. You authenticate
2. You need to select what you want through a menu
3. You enter things in a form
4. Validations click in to check if you do the right things
5. Finally the process is run
6. You can get your transaction as a printed report.

This is exactly what we have in APEX, no?

Why make it complex if things can be simple ;-)

Oracle Shop

The APEX Development team created a more sophisticated APEX application, which is
the Oracle Shop, where you can basically order Oracle software.
The application has some nice features like:
• it integrates with Oracle Apps in the backend
• it uses webservices to check your credit card
• it has some nice integration with Javascript.
The Oracle Shop is already live; you can see it here.

Seven demonstrations of APEX 4.0

1. Websheets (start at Minute 25 in the video). Business people are able to create an
application very fast with a lot of features. You can see this as a very rich Web
2.0 Interactive Report with collaboration features built in. But also for
experienced APEX people this is a good thing as you can transform it into a real
APEX app. I have included a screenshot with the main differences between
APEX and Websheets.

2. Dynamic Actions. This basically allows developers to write more AJAX
applications without needing to write Javascript. E.g. if you want to show an item
dynamically based on a value of a previous item.
3. Upgrade of Anychart 3.3 to Anychart 5.1. Not only will you get nicer looking
charts, you will also get more types of charts. I also find it useful the wizard got
improved, so you see directly which type of chart you are going to get. If you
wanted to have the Anychart 5.1 charts already in APEX 3.x you had to use the
Anychart Integration Kit for APEX.

4. REST Web Services. It will make things easier to integrate with other sites and
applications. In the video you see the integration with Yahoo Maps, Flickr, Picasa
and Amazon. Jason also mentioned that APEX Collections will get stored in an
XMLType column, so it will be preparsed and the query will run a lot faster.

5. Plugins (in the Shared Components section). APEX 4.0 will allow people to
extend the built-in functionalities. So we would be able to create our own widgets
(item types, region types). These plugins you can find on a specific site where
people can share them. You would create these plugins in PL/SQL. E.g. the video
talks about a plugin to get a video region, or a star-rating item.

6. Improved Interactive Reports. E.g. create your own "where" clauses inside
your IR, be able to notify people when a specific report gets changed, be able to
provide saved reports (as a developer and not like now that the end-user needs to
save the report), share reports, download the IR as a searchable html, etc.
7. Improved Application Builder. E.g. make the most important button yellow,
very cool search functionalities with regular expressions.

APEX 4.0 features that did not get demoed, but are things to look forward to:
• Declarative Tabular Forms.
• AJAX Client-Side Validations.
• Improved Error Handling.
• Improved Tree Controls.
• jQuery and jQuery UI.
• Item Attributes.
• Javascript Date pickers.
• Editable combo-box.
• APEX Listener is faster and has bigger possibilities than mod_plSQL. It will also
be able to have native access to the filesystem by using the APEX Listener.
• This will help a lot if you store your Javascript files, etc on the filesystem. It will
also simplify printing as FOP will be burned in.
• Tight integration with SQL Developer Data Modeler.
• In APEX 4.0 the wizards are also a lot shorter and more intuitive.
• Better integration with Subversion (more declarative).
A release date got also mentioned for APEX 4.0: planned for early 2010. Just a reminder:
APEX 4.0 will only run on Oracle Database 10gR2 and higher. That is another reason for
people to upgrade their database.
The APEX Dev team also showed a new packaged application with higher quality and
ready to see Web 2.0 features (such as APEX Teamspace) which allow team
collaboration. It's a nice example of a Web 2.0 application. This would also run in APEX
If you want to see it live, you have a chance to see it again on Oracle Open World!

Wednesday, October 28, 2009
At the demo grounds of OOW09 the APEX Development team showcased APEX 4.0. I
spend quite some time at the demo ground to play a bit with APEX 4.0 and have a real
feeling about this new version. I liked it a lot, but to be fair not all wizards were
finished/polished yet and while I was testing I wanted even more features. There are only
so many enhancement requests they can put in, so it will be a challenge to define the final
list of which will be included and which will be postponed to APEX 4.1.
I took some screenshots to show you how things look like and commented a bit on it.

All the screenshots might look different when APEX 4.0 hits the road, so don't take it for
granted it will be like that in the final version.

I already wrote some other blog post and posted a video over a year ago (!) about
Websheets. It will be "separate" from APEX, e.g. you create a Websheet or an APEX
app. I see Websheets as "APEX lite" or "APEX for business people." It's even easier and
faster to create a Websheet than it is to create an APEX application. Everything is in
meta-data, so Websheets are not based on real tables, but the tables will be defined in
meta-data. This allows people to change the structure of the table on the fly (e.g. add
It has some other nice features like inline editing, sharing of your data (security built in),
flashback capabilities and so much more... definitely one of the reasons to go with APEX

When you log in to APEX 4.0 you see that the Application Builder has got a nicer look
and feel. The new color is blue instead of green and it looks as if an enhanced version of
Theme 20 is used.

Drilling down into an application gives you the next screenshot. The quick links which I
use a lot (edit page, wheel to access shared components...) got extended. The search
functionality there will save everybody a lot of time.

At the last conferences I gave a presentation about "Mastering an APEX page." It looks
like I should redo that presentation when APEX 4.0 comes out. Although the Page Layout
already changed a bit (e.g. you have now a Dynamic Actions section) insiders told me
that it's likely to change more.

If you don't like to touch Javascript yourself, but you need things to happen on the client
(cascading LOVS, hide/show items and regions) the APEX Dev team built Dynamic
Actions for you. It allows you to build these things in a declarative way.

The different actions in Dynamic Actions through the wizard.

If you edit the Dynamic Actions you can change it even more.

The Utilities section got revamped with more features and more logical organized items.

One of the new items is the Advisor. Before you could find that in Patrick Wolf's APEX
Essentials. So now it will be built-in and it got more enhanced as well. This will definitely
mean everybody can do easier quality checks of their applications.

Team Development will be another nice feature. It allows the people on the project to
work more closely together and all throughout the APEX interface. New features, bugs
and to-do's can be logged and be assigned to people. This is an example of something we
built ourselves, too, to make our live easier but, like a lot of the things we did before in
our own way, APEX 4.0 will give you everything (or at least a lot) built-in.

The new Shared Components section got some more features; the most important one I
would say is the access to the plugins.

I'm expecting a lot of the ability to have plugins in APEX 4.0. I've certainly a couple in
my head I'd like to write, but it's just the fact that it opens up APEX in every way. If you
do something in many projects and you can't use shared components for it, it makes sense
to write a plugin, so it makes it easy to reuse.

As a frequent reader of this blog you probably know by now that Anychart 5 will be
integrated in APEX 4.0. The new wizard looks a lot cleaner. You see which chart you

want and select that from the start in the wizard. There are also other types of charts
available now e.g. Gauges and Gantts.

The screenshot below shows the new wizard for creating Maps.

The next screenshot shows you the Enhanced Interactive Reports with a Map on the same
page. As you can see the Interactive Report got some new features like Group By.

I think APEX 4.0 will change the way we write applications. APEX 4.0 brings us again to
another level of web development in a declarative way. You'll be able to do things in an
easier and faster way than ever before. I already look forward to next year when we can
develop with it.

Saturday, December 19, 2009
You can evaluate Oracle Application Express 4.0 now yourself. Oracle released the Early
Adopter version ... just got access to the new version and it looks
cool so far ...

Not all features are available yet (e.g. Websheets) but there are so many other nice things
in there that it's definitely worth to have already a look now.
So try it out yourself and give feedback to the APEX Development team. The more
feedback the better the production release ;-)

Sunday, December 20, 2009
The Application Builder and more in particular the Page View has two modes in APEX
You can view your page, as you know from earlier APEX releases, in the Component

Or, from APEX 4.0 onwards, you have the possibility to view your page in a Tree View:

This is my view on it:
• With the Component View you to see everything on the page at once. You can
just click on a link and it brings you to where you need to be. But you might have
to scroll and especially for big pages with lot of conditions and different branches
it might be harder to follow the logic.
• The Component View also works on your mobile device (nice if you have to do a
quick update through your mobile phone).
• The Tree View is a new view on an APEX page. It's structured more logically (a
bit like the events view in APEX 3.x). It's also more condensed, it gives you a ton
of extra possibilities and ways to develop faster. E.g. if you want to put one item
before another, you can just drag-drop.
• By hovering over items you get extra information (e.g. conditions), you can
right-click on the items of the tree and depending what you clicked you get the
possibilities of that item. Double-clicking on an item brings you to the details.
The more I use the tree, the more I like it, and I'm starting to become a huge fan
of it. The only two drawbacks I see are that when I don't have a mouse with me,
it's harder to develop (e.g. on my Mac I need to click the CTRL button to mimic a
right-click); the other drawback is that it won't work on a mobile device.

My first choice will probably become the Tree View. I think in this view of the page you
will make fewer "mistakes" and develop higher quality pages, just because of the
structure. You'll also develop faster, which is a big thing for me. But I do think the APEX
Dev team should keep the Component View as well, as occasionally I probably want to
go back there (developing mobile, or if I don't have a mouse).
It looks like there are 19 new APEX Views (compared to APEX 3.1.2).

If you go to Application Builder and select from the right-hand Tasks the "APEX Views"
link you see a description of all views.
For the new views this is the description:

For some reason, the Team Development views are not listed in this report.
It's always interesting to review these views as they give you more insight into your
application, or to use them to have a look at the application behind the scenes. We have
been using them for reporting an application or sending automated QA feedback.

Sunday, December 20, 2009
I looked at the package we would be able to use in APEX 4.0 and saw some new ones.
Packages make it possible to do things in your own PL/SQL code which APEX does for
you in the wizard. E.g. if you want to call a webservice, you can use the APEX Wizard to
set this up, but it might be useful to do that from your own PL/SQL procedure or from a
process in your APEX app.
On I had to write a lot of custom code to read the different rss feeds. If
the APEX Development team opens up the packages they use behind the scenes you can
just leverage these and don't need to write your own.
Another good example which happened in APEX 3; everybody wanted to send mails with
attachments, so we all wrote our own package to do that, in APEX 3 (if I remember
correctly) the APEX Dev team provided a new package called apex_mail which did that,
so you could just use it to send emails without having to write your own anymore
The same with APEX 4.0, the more package they provide, the better. So here are the new
ones I found so far (it's hard to research them without SQL Developer or having access at
the code):
The packages speak for themselves I guess ;-)
Let me give you two examples; you can just do desc apex_Javascript yourself in SQL
Commands to review the full definition.

SQL> desc apex_Javascript

So it looks like we can add attributes, add onload events, etc., directly from a PL/SQL
package. You probably want to use this package a lot when you write your own plugins.

SQL> desc apex_web_service

This is a really cool package. It's the same (as far as I can see) as the flex-ws-api Jason
Straub wrote. If you need that already in APEX 3.x you can download it from the sample
code website.
Doing research on APEX 4.0 is so much fun ;-)

Sunday, December 20, 2009
APEX 4.0 includes so many nice features out of the box now, that you can't stop
smiling ;-)
I'm doing these series of blog posts more from the perspective of what has changed and
how your development effort will change by using APEX 4.0.
The community built things around APEX (2.2, 3.x) to help us; e.g. Patrick Wolf made
some great things (already some time ago now) like his APEXLib framework and the
APEX Advisor. Now that Patrick is in the APEX Development team, it's nice to see a lot
of this coming back as built-in components.
This post is about the built-in Advisor, which you find in the Utilities section in APEX
4.0. I'm sure it will help to write higher quality of code. Before (APEX 3.x days and
prior) the flow was like: create database objects (tables, views etc), create application,
pages, add validations, create shared components, make sure security and performance
are good by manually checking things. A change came in: adapt database objects, adapt
pages, etc., hoping you changed everything correctly. Some of us built a QA tool to check
things by running a package/query or by using the Advisor Patrick built, but I think a lot
of people didn't do that.
So how does this process look in APEX 4.0?
• Create database objects.
• Create application.
• Create page and check directly if it's "good" (see screenshot).
• Create shared components, etc.

Change is coming in:
• Change database objects.
• Run the Advisor and see directly which items you need to change or where things
• Change pages and check your pages directly.
• When all done, run the Advisor again for the entire application (see screenshot)
and you are good to go.

It's amazing if you upload an existing application how many things the Advisor might
suggest you have a look at ;-)

Having this feature built in is awesome. I used Patrick's Advisor (for APEX 3.x) before
but sometimes I forgot to run it, etc. Now that it's built in it's so much easier.
While I was discussing with John Scott he had a really good suggestion; it would be nice
if we could schedule a run of the Advisor (e.g. every night). Also adding our own checks
would be nice, but we could get around that already if we could just call the Advisor from
We would then email the results or store it in our QA repository.

Monday, December 21, 2009
In the last two days I developed with APEX 4.0 EA. Although I already played a bit
during OOW it's different when you have some more time.
As I already mentioned earlier, it's the best APEX version so far. It looks good, feels
smooth and there are many new features. Although this is not yet the "full" version of
APEX 4.0 I would already be happy to just get this.
The blog posts I did so far:
• APEX 4.0: writing higher quality applications by using the Advisor
• APEX 4.0: new public packages
• APEX 4.0: dictionary views
• APEX 4.0: Tree View vs. Component View
• APEX 4.0 EA available
• APEX 4.0 Screenshots and first impression
• APEX 4.0 Highlights and Video.
I'm going to hold a little pause in doing blog posting on APEX 4.0.
There is a lot more to discover, so you might play with it and check other new features
I plan to write more about APEX 4.0 in January. These are in my drafts:
• APEX 4.0 Charts, Maps and Gantts
• APEX 4.0 Dynamic Actions
• APEX 4.0 My first plugin
• APEX 4.0 Team Development

Wednesday, January 06, 2010
Before I just played around with APEX 4.0 and tested the new features and created some
quick apps, but a week ago I made the decision to really see what APEX 4.0 can give me
in a real project.
So the plan I had was to start this project in APEX 4.0. It's a risk as I might never be able
to import it again in the next version of the Early Adopters release, but I made this
conscious decision because I really wanted to see how much time APEX 4.0 could save
I'll do a proper blog post about the outcome once I finish the project, but I already wanted
to discuss the plugins part of APEX 4.0.
In my project a person needs to be able to see and select a category. If the category
doesn't exist he needs to be able to create it. So if I was in APEX 3.x I would look at
using a select list or a popup LOV. Possibly I would add a plus button next to it and write
some Javascript code to show a text item to enter a new category if it wasn't already in the
system. Alternatively, I would use some jQuery plugins like the autosuggest or an
editable select list / combo-box.
But in APEX 4.0 there is a built-in item type "textfield with autocomplete" which I could
have used, but one of the drawbacks of that is that you can't really look what is in the
system already without typing some letters. So I searched for an editable select list, but
that item type didn't exist.
It would take me about five minutes to write some custom jQuery code and hook up the
plugin to get an editable select list, but I would need to do that for every project again on
every page I want to use it. So I thought it's a good moment to create such an item type
myself, which I would be able to reuse in every project.
It took me about three hours to understand how the plugins worked, read Patrick's
documents and look at his examples, and use that knowledge to create my first plugin. So
I need to use this plugin 36 times to break even, compared to if I did it the custom route.

But the big advantages of using the plugin are:
• the implementation will be the same every time
• more people can use it
• you don't need to know Javascript to get things working.
You can see the Editable Select List Plugin working and be able to download it here.
To install the plugin in your own application, go to Shared Components > Plugins and hit
the Install button.

Tell it in which app it needs to be installed into (plugins are app specific).

And review the code, my plugin is called AE Sexy Combo, because it's based on the Sexy
Combo jQuery plugin.

So now you should be able to create this item type on your pages.
You add a new item of type Plugins and select the AE Sexy Combo.

You give it a name and you need to add a select statement to it (in the LOV section of the
item) and it's ready!

It didn't take me too long to understand how the plugins worked especially not if you
investigate the existing examples which you can use as a starting point. I found it not easy
to find my coding mistakes e.g. I'm not sure the plSQL code gets parsed, but it took me
some time to find I missed a ")" somewhere. But I used the
apex_plugin.debug_page_item and found that helpful. It would be nice to be able to
upload multiple files at once and be able to reference the css like you do with Javascript
e.g. apex_Javascript, get an apex_css.
I like plugins very much; I think if people start to share that we can extend APEX
ourselves all the time without having to wait for another APEX release. It's a very
controlled environment, so much more secure to use especially for non-advanced

Tuesday, January 26, 2010

So what is all that about Dynamic Actions in APEX 4.0?

Basically, before, we had to write a lot of Javascript to get things happening on the client.
E.g. you wanted to show or hide a field or a region depending other values on the page.
From APEX 4.0 onwards we can do a lot of these things declarative (through a wizard).
You have two types of Dynamic Actions: Standard and Advanced.

This post will have a closer look into the Standard Dynamic Action. (Advanced will be
covered in Part 2).

You will need to specify the selection type of the page elements that define when the
dynamic action will fire. You can choose out of: Item(s), Region, DOM Object and
JQuery Selector.
Depending on the type you chose you'll see different things to fill in, e.g. the item(s) or
region name, the condition and value when the dynamic action needs to fire.
Next, you specify the event type for the dynamic action. In conjunction with the
triggering elements defined in the "When" region, this is used to define the actual event
on the page that will cause the dynamic action to trigger.
So, in the above example, I want to fire the dynamic action when my P5_SELECT equals
to Y and it looks for it whenever I change the select list.

Next, you define what you want to do. In my case I want to disable an item when the
value of the select list is N and enable it again when the value is Y.
Finally, I told the dynamic action what field it had to enable/disable. You see it live here.

If you go back into the App Builder and look at your page (Tree View) you see the
dynamic action below (if you still use the Components View, it's at the end as well and
the screenshot looks like the very first picture at the top of this post).

You can still edit the dynamic action and configure it further.
I like Dynamic Actions a lot. It will definitely speed up development as it's now just built
in. Not a single line of Javascript you have to write. Obviously we now did only a simple
thing and you still need to test things to see if they do what you expect... I tried to
Enable/Disable a button, but that didn't work yet, but like the above example with an item
it worked like I expected.

Monday, February 22, 2010
If you are interested in a Standard Dynamic Action in APEX 4.0, you should read this
blog post.
In this post I'll cover how to create an Advanced Dynamic Action. "Advanced" allows
you to create more complex native Dynamic Actions such as "Add Class" or "Set Value"
and also plugin Dynamic Actions, that are installed in your application.
In this example I want to retrieve the department for a given employee.

In the Application Builder you find a new region (tree record) called "Dynamic Actions."
Right-click on that and click Create.

In this post we select Advanced, as we want to create an Advanced Dynamic Action, that
does more than just show/hide or enable/disable.

Give the dynamic action a meaningful name e.g. Refresh Employee List.

Tell the dynamic action when it needs to fire. In this case I want that something happens
whenever I change from Employee (P25_EMPNO).

Select the action you want to do. In this example I want to set the value of an item (the
department) for an employee. The value can be retrieved in a number of ways, but in this
case I search the department with a SQL Statement.

Finally you tell the dynamic action what item it needs to update. What you want to update
can also be a Region, a DOM object or a JQuery Selector.

Hit the Create button and you are good to go! Not a single line of Javascript to get this
You see the example in action here.
If you want to combine different actions in one dynamic action, that is possible too. You
can add multiple actions when the condition is true or false. (See True/False Actions).

There are many Actions you can choose from. If you imported or created Dynamic
Actions plugins, you find them in there too.

Dynamic Actions are VERY, VERY powerful and have an unlimited amount of
possibilities. Although the above is classified as an "Advanced Dynamic Action" it's still
a fairly simple example. In Part 3 I'll show how to combine plugins with Dynamic
Actions to be even more powerful!

The key reasons why I like Dynamic Actions so much:
• It's a declarative way of creating more interactive websites
• It allows people without Javascript experience to create more dynamic websites
• It allows more experienced people to get the job done faster
• The dynamic content is more structured and always in the same format
• The dynamic content can be found at one place, directly in the App Builder (not
searching in different Javascript files anymore!)
• The Javascript is more maintainable (and possible more performant and more

Thursday, March 04, 2010
In APEX 4.0 EA2 the Websheet functionality is enabled. Websheets allow you to share
information with others in a very quick, user-friendly and secure way.
Let's have a look at an example. If you go to Application Builder in APEX 4.0 there is a
new type there called "Websheet Applications."

We create a new Websheet Application and give it a name and possibly some content that
will appear on the home page. You can type the content with the WYSIWYG editor (CK
Editor) by clicking on the arrow button.

Before it creates the Websheets, the wizard gives a summary page and that is it.
Websheets are even simpler to create than a normal APEX (database) application.

You can compare Websheets with a preconfigured APEX application. A whole

framework is built for you with a lot of features out of the box. You can just use all that.
When you run the Websheet from the App Builder you come into "Websheet-land." As a
default Authentication mechanism it uses the Application Express Account. But you can
change that by going into the Websheet Properties to Public Access, Single Sign On,
LDAP or Custom.

When logged in, you come into the Websheet Framework. As we have Websheet
Development Access, we can change the Websheet. In the top menu and on the right-
hand side you see what you can do. E.g. you can add pages, sections, data grids, etc.
There's a lot to explore there!

In the different sections of the page you also have Edit links, which allow you to easily
change the text, all with a (WYSIWYG) html editor.

I see two big parts of Websheets; sharing information and data. The information is done
through using pages, sections, tags, files, etc. just like you do in a wiki/CMS. But where it
outperforms all the typical wiki or content management systems is with the data part!
One of the killer features of Websheets are the Data Grids. If you go to Data > Data Grids
and create a new Data Grid, you have the choice to start from scratch or from Excel/Text
with copy/paste. That allows you to create "a table" on the fly which holds your data

(actually it's a record in the Websheet repository). This Data Grid look very similar to an
Interactive Report (see Actions button), but it allows to do inline editing and a lot more
(see Manage button)!

Websheets are too big to discuss in one blog post. There are so many areas which could
be covered. There's the wiki part, the data part, the administration (security, dashboards,
Maybe one last thing: look at the url of a Websheet (login with end/end). It doesn't start
with f?p... it starts with ws?p ;-)

Sunday, March 14, 2010
If you didn't have time to review APEX 4.0 Early Adopter I and II, but you want to have
a quick look what new features will be in APEX 4.0, you can do that now.
There is an APEX 4.0 New Features Application which shows a lot of the new features in
action; e.g. the screenshots below show the new features for tabular forms in action.

If you want more detail about the new features and when they got introduced (e.g. you
reviewed EA1 but want to see what is new in EA2), you can go to the APEX 4.0 New
Features Description.

I find it very useful to have something like above.

Thursday, April 29, 2010
I like to get where I need to be in the fastest possible way. In APEX 4.0 they improved
the navigation. On the top right you have a search box, which is a very intelligent search!
I typed 11675:1 and it went straight to page 1 of application 11675!

In the search you can also type table names, etc. and it will show a list of every
component you used that table in. In short, the search is very powerful.
Cool, eh?

Monday, May 10, 2010
APEX 4.0 just got a new refresh with the latest build. The new build is Early Adopter 3
and has release number

This should be the final beta before the release of APEX 4.0, so it's definitely time to test
it out if you didn't do it yet. I'm currently updating our training material to this new
release, so you can expect new training material very soon.
We plan to do some APEX 4.0 training and I'm working with the Oracle User Groups to
do APEX events to showcase this new release in many other events. APEX 4.0 is
definitely the biggest release ever and it will change the way you develop Web 2.0
applications significantly.

Wednesday, June 16, 2010
Tomorrow during my presentation about Team Collaboration in APEX 4.0, I'll talk about
Websheets. While I was going over my presentation again I came across two things I
thought are interesting.
Firstly, if you want to search in SQL Workshop for the Websheets table, you want to type
APEX$ as they all start with that. However if you type APEX$ in the search it doesn't
find the tables. To find the tables you have to escape the $ sign, so your search becomes
"APEX\$", then SQL Workshop finds the tables.

Secondly, when you have a closer look at the columns, it's commonly known there are 50
date, 50 numbers and 50 varchar2 columns. But I didn't notice before, there is also a
Geocode column in the definition of the table. The last weeks I'm involved in a project
that uses Geocodes, so I find it interesting to see there's already something in Websheets
for that...

Monday, June 07, 2010
As the APEX Development team took the last step (upgrade of in the
production release of APEX 4.0, we can start to count down for the public release!
So I made a bet with myself... Every day till the public release of APEX 4.0 I'll blog
about another new feature!
The way I'll do it, is simple: I'll migrate the DG Tournament application to APEX 4.0.
DG Tournament is an existing application I originally wrote in 2006 and upgraded along
the years with the new versions of APEX.
What do I hope to show you?
• How to move from APEX 3.2 to APEX 4.0
• Show new ways of doing your development
• Rewrite existing (custom) functionalities by making use of built-in APEX 4.0
• Incorporate new features.
I've no idea how much longer the public release will take, but there are over 170 new
features in APEX 4.0, so I should be fine on that side. But maybe they will be really fast
in shipping this release and I won't have enough time to get the app migrated. Time will

Monday, June 07, 2010
This blog post is part of a series posting "Count Down to APEX 4.0 Public Release."
So let's start with preparing our application to move to APEX 4.0. As you probably will
create a test instance with APEX 4.0 where you try your production application before
"going live," I'm going to do the same. I'll use as my test instance of
APEX 4.0.
The first thing I have to do is to package my current application (APEX 3.2), so I can
quickly go from my current server and install it on the APEX 4.0 test server.

I'll make use of the Supporting Objects feature in APEX to include all my database
objects and data with my application (just like you have with a packaged application).
But before I can use it, I need a SQL script with all my database objects and data. To get
such a script I'll use SQL Developer (or you might already have the scripts in Subversion
or so).

In SQL Developer I go to Tools – Export Database and I'll follow the wizard to include
all my objects.

The final step will show you an overview of the objects it will include in the script.
Click the Finish button and wait for the script to generate.

Next you can upload this script into the Supporting Objects section of APEX.

In the Installation Scripts section you should see something like this:

Next you can take an export of your application.

Save the file somewhere because, tomorrow, we are going to import it into APEX 4.0.
So stay tuned...

APP IN 4.0
This blog post is part of a series posting "Count Down to APEX 4.0 Public Release."
Yesterday, we took an export of our application and included the script to create the
database objects and data in the Supporting Objects of APEX.
So the only thing we need to do now is import our application in APEX 4.0.
In the Application Builder click on the Import button and select the exported file.

The file will import into the APEX Repository.

Next we have to install the application, so click the Next button.

Select the parsing schema and how you want the Application Id assigned to it. Finally
click the Install button which will install the application into your workspace.

When the installation of the application is finished, the wizard won't stop yet, as we have
Supporting Objects included in the export file. So the wizard asks if you want to install
these Supporting Objects as well.
As we need the database objects and some data we click Next and make sure the Yes
option is selected.

We get a confirmation message which asks if we are sure we want to go further with the
install, so click Install.

The wizard comes back with the result of the install of the Supporting Objects.

In my case I got a few errors. When you click on the Install Summary button you can
review the outcome.

Most of the errors were data related. It's a pity SQL Developer wasn't able to produce me
a "correct" SQL which just works.

In this case I prefer to build a new script, delete my objects in APEX 4.0 and rerun the
script for creating the database objects. You don't need to install the full application again,
as that was successfully installed. You can just upload your new file to SQL Workshop
and run it from there.

To get data or database object from one database to another I prefer the methods in this

1. Datapump when possible (in my case I can't use it as I don't have direct access to
the database of
2. Separate scripts for database objects and data
3. Depending the size of the script upload to Supporting Objects or run manually
(for really big data sets you can't use APEX to upload your data).

So, whenever you finished with the database objects and loading the data, we can go
further with real APEX 4.0 features... but that is for tomorrow.

Wednesday, June 09, 2010
This blog post is part of a series posting "Count Down to APEX 4.0 Public Release."
Yesterday we imported our application in APEX 4.0. The import went fine, but we had
some errors with the script in Supporting Objects.
So, today, I looked at the errors and fixed them where appropriate (mostly data issues). I
used the SQL Data Workshop in APEX 4.0 to load the data manually. One issue I found
was to import blob content. As you can upload your own picture in DG Tournament, this
gets stored into a blob column. Also the image for the teams is stored in the database. But
SQL Workshop or SQL Developer is not able to generate a script for that, so you will
have to use SQL Loader or a custom PL/SQL procedure to get them loaded. I didn't do
that yet.

Now that I'm happy with the back end, the first thing I want to try is run the application
and see if it works... Click here to see how the DG Tournament application looks like in
APEX 4.0.
So, not bad at all... but not completely perfect either. E.g. we get a Javascript error on the
first page. Looking into that error is for another day.

Now I'm going to use a new feature of APEX 4.0: the Advisor. The Advisor will look at
my application and tell me what is not correct. Cool, he!?
In the navigation bar we click on the Application Utilities icon.

We get to a page with a lot of nice utilities. It's not my goal to explain all of them in this
blog post, but I'll use one, the Advisor. So we click on the Advisor button (bottom left).

We want to leave the default checks like that and click on the Perform button. As you can
see, the Advisor will check for errors, performance, and security, etc.

We'll keep that running for some time. Depending on the size of the application it can
take seconds or minutes. Finally there are the results... It looks like I've some things to
look at!

In APEX 4.0 I'm using the Advisor constantly. Whenever I finish a page I let the Advisor
run for that page. Whenever I want to do a release I run the Advisor for the full
It would be nice if we could get this Advisor to run every night and get the outcome by
mail the next morning. I didn't look yet if there's an API available to do this now, but a
few people, including myself, mentioned this at EA1.
Back to the app, now it's time to verify the recommendations of the Advisor and adapt
Tomorrow, I'll use another exciting feature which you also find in Application Utilities
(screenshot on this page)! Anybody want to guess which feature I'll use?

Thursday, June 10, 2010
This blog post is part of a series posting "Count Down to APEX 4.0 Public Release."
In the previous posts we imported our application (and database objects) in APEX 4.0 and
ran the Advisor to check that the application didn't have any errors.
As I said yesterday, we are going again to Utilities, but this time we click on the
"Upgrade Application" button (second left from the bottom).

The following screen displays the available upgrade types along with the number of
objects that can be upgraded. This is the fastest way to make use of the latest features of
APEX 4.0 and do a bulk upgrade of the different components (new features).
• You can replace the old date picker with a new one
• If a value can't be null, that can be specified native in APEX 4.0, so we won't
need to add an extra validation in (like we had to do in APEX 3.x). That is what
they mean with the first (Update Value Required Item attribute to Yes)
• Enabling a lot of new features for the Interactive Report
• Upgrade all your charts (based on Anychart 3) to the new charting engine in
APEX 4.0 (Anychart 5)

So we click on the candidate objects count to review the candidates. First, I clicked on the
Date Picker upgrade link.

We select the ones we want (check box in front of the records) and click the Upgrade
It will come back if it successfully upgraded the components.

We can now do the same for the other types. So click on the Upgrade Application
Summary link in the breadcrumb (or you can select another type from the drop down),
you'll see that the ones that are already upgraded won't appear anymore.
The only thing I would be aware of, is if you used a workaround against a problem (e.g.
the LOV's null), you need to make sure you undo that before/after you migrate.

Finish them all and you are ready for the day again... you see the updated app in APEX
4.0 here.
Yesterday Roel knew the answer what my topic of today was going to be... you have an
idea what I'll do next? You have more options now, no? ;-)

Monday, June 14, 2010
This blog post is part of a series posting "Count Down to APEX 4.0 Public Release."
In the previous posts we imported our application (and database objects) in APEX 4.0,
ran the Advisor to check that the application didn't have any errors and upgraded some
components like charts, validations, etc. to their new equivalent in APEX 4.0.
We still have some Javascript errors in our application and we should now open, page by
page, and see if we have any issues or if we can make better use of the APEX 4.0
We could take a piece of paper to write down all the changes we want to make to the app
or use tools like Jira, Fogbugz and many others. Instead I'm going to use the feedback
features of APEX 4.0 in combination with Team Development. This allows me to have a
structured plan of the changes I want to make.
We'll create a new (special) page, called the Feedback Page.

We can change the attributes of this page, but we'll just go with the defaults for now.

That's all you have to do to enable feedback for your application. Now people can tell you
what they like, don't like and want improved... all that information will appear in the
Team Development section of APEX 4.0.
The wizard created a new page and an entry in the navigation bar (which you find in
Shared Components). So you can manually do these steps too.

As I already included the navigation bar in my custom look and feel of DG Tournament, I
literally didn't have to do anything else. I just got the Feedback button (link), which, if
you click on, you get a popup to enter feedback information.

As a default you get the above items on your page, but you can add that like you wish.
The Feedback Type can be off: General comment, Enhancement Request or Bug.

If you look at the Page Process of the Feedback Page you will see the
apex_util.submit_feedback package is used to get the data into Team Development.

The most right-side button is Feedback. When we click on that, we see a dashboard of all
the feedback for the applications in this workspace.

As you can see, I entered three feedback comments, but I didn't treat the comments yet.
I can now convert the feedback into a bug, to do entry or a feature.

We'll click on the Feedback tab and see all of the feedback. You have different views of
this feedback; you can see open, closed or all and can see the feedback in Extended or
Basic modus.

From this screen you click on a Feedback entry.

You update the feedback entry and can change the status, etc.

That is how I would go forward. I would let people test our migrated application and ask
to enter their comments as feedback. I, as a developer, would do the same. It gives me
(and project manager and other developers for larger projects) and the customers insight
into what has to be done and we can properly plan.
I didn't touch the Milestones, Features, To-Dos and Bugs, but it’s worth having a look at
those as well. It's all in Team Development.

Wednesday, June 23, 2010
It's finally there... the day we all waited for :-)
You can download APEX 4.0 production release at this very moment.

Wednesday, August 04, 2010
If you upgrade your application from APEX 3.x to 4.0 you might encounter some issues.
At ODTUG I did a live migration of an application written in APEX 3.2 to 4.0 and I
talked about some of the issues I discovered and how I worked around them. I'm doing
the same presentation at APEXPosed in Brussels in October. You also might have seen
my previous posts where I upgrade DG Tournament from APEX 3 to 4.
On the Known Issues page you see the issues categorized nicely. If the issues can be fixed
by working around it, it's also mentioned there. Oracle is working hard on a patchset
(4.0.1) and they hope to release it soon. On Metalink you can already find patches for
specific issues, too.
I plan to write some other blog posts with steps I did when upgrading DG Tournament to
APEX 4.0.

Wednesday, August 18, 2010
Hi! Just read Joel Kallman's post that the Oracle Application Express (APEX) team
released 4.0.1 which corrects a number of issues found in APEX 4.0.
I recommend going to 4.0.1 as soon as possible if you have 4.0 installed.
If you still have 3.x running and want to upgrade to 4.0 you can directly download the
4.0.1 release and install that.
The new version of APEX is

Tuesday, September 07, 2010
In a lot of my APEX 3.x projects I used jQuery to extend the standard functionalities of
APEX with some more interactive (client-side) components.
In jQuery there are very nice plugins, like a modal window, a grid, tooltips, etc.
If you try to run your APEX 3.x application in APEX 4.0 you might find these jQuery
components/plugins are not working anymore. The cause can be multiple:
• You might have used an older version of jQuery and the plugins you used with
that, which are not compatible with the jQuery version in APEX (1.4).
• You load jQuery, but APEX loads their built-in jQuery too and things get mixed
During the migration of my APEX 3.x application to APEX 4.0 I just take off all
references to jQuery I made myself. Just make sure that in your template the #HEAD# is
before any other jQuery plugins you try to run. Also make sure the jQuery plugins you
use are compatible with jQuery 1.4.2. APEX ships with a lot of extra jQuery plugins like
jQuery UI, js-tree, etc. so, if you used that, it's not necessary anymore to include them.
(To see a complete list of files that ship with APEX, look into /images/libraries/)
Before, I loaded my files as part of my Page Template, but I'm not sure I would still do
If you switch from template you lose the references. It might be better for maintainability
point of view to include it in a region on Page 0. It will have a small performance hit, as
APEX will have to look for it on Page 0, but it makes maintainability easier.
But, going forward, I'm converting all my custom Javascript and jQuery plugins to APEX
plugins and the files get loaded as part of the plugins. A lot of the Javascript can
disappear as it can be replaced by the built-in Dynamic Actions of APEX 4.0.
Hope it can help some of you when you see Javascript errors when you try to run your
APEX 3.x app in APEX 4.0. But don't panic too soon, it's probably just the way jQuery
gets loaded.

Monday, September 13, 2010
It was a long time ago I promised this post, so finally, today, I found some time to finish
the post.
In APEX 4.0 the Tabular Forms got enhanced quite a lot. To make use of these
enhancements requires some manual changes of the page the tabular form is on, so when
you upgrade your existing APEX 3.x (or older) applications the tabular forms are not
upgraded automatically (or at least not completely), but they should still work like they
did before.

The enhancement I want to discuss in this post is Adding a row to the tabular form.

Before APEX 4.0, when you hit the Add Row button, the page got submitted and a
specific Add Rows process on the page got called.

In APEX 4.0 that changed: the page is not submitted any more. When you hit the Add
Row button, some Javascript (addRow()) is called to add a new row to the tabular form.
So to make use of this enhancement, you need to make three changes:

1. Change the button to not Submit the page anymore, instead it should "Redirect to
Url" with as Url target: Javascript:addRow();
2. Delete the Apply MRU after submit processes (with the condition linked to the
Add Row button): as the page is not submitted anymore when you click the Add
Rows button it is not necessary to have that process anymore (obsolete)
3. Delete the Add Rows after submit processes (obsolete).

To identify the pages you have to change manually I use this query:
where PROCESS_TYPE in ('Multi Row Update','Add rows to tabular

It results in the output below, and shows which pages you still have these processes on:

Another thing I found while upgrading my applications to APEX 4.0 related to tabular
forms: if you still used an old template layout, the new functionality didn't work (missing
of some tokens) and some other things which got already fixed in the 4.0.1 patch (see
patch notes).

Monday, September 06, 2010
In the last week I migrated more applications from APEX 3.x to 4.0 and thought to share
my thoughts on the Theme and Templates part of the application.
I've applications that were initially built in APEX (HTMLDB) v2 and others built straight
with APEX 3.x. Some applications used a built-in theme, but more had a custom look and
Most migrations went OK, but I did have issues when I used templates which didn't have
all tokens (#...# things in html that get replaced at run time by APEX) e.g. with tabular
forms (but I'll do a specific blog post on that – and is already a known issue).
I'm personally following the path of installing a new APEX 4.0 theme for my application
and applying changes to that to get the same look and feel I had before. Or at least, I
verify my custom templates to support the new APEX 4.0 features.
I also try to update it to a nicer and more up-to-date look and feel.
The reasons why I'm following this approach are multiple:
• better w3c compliant
• easier for screen readers (for disabled people)
• fresher and more up-to-date look and feel
• support for all new APEX 4.0 features
• more div/css based layout, which makes it more clean and easier to adapt in the
But obviously you should decide yourself if it's worth updating your templates in your

Thursday, September 09, 2010
I tend to use the grouping functionality to logically group my APEX pages.
E.g. I've a group called "Admin" which hold all the Admin pages.
I find it easy to see the pages for that section of the application and I can verify if my
security model is fine on these pages. E.g. the pages should be protected with the Admin
It also helps me to separate the work between developers. If I tell my colleague to go and
change the Admin section, it's easy to find for that person.
You can also use ranges of pages for the different sections of the application.
E.g. 10000–20000 is for Admin pages.
Before APEX 4.0, the Grouping of Pages was in the Task area on the right-hand side of
the page, but that got changed. Now you find a lot of the Goodies in "Application
Utilities" (see red arrow in the quick pick icons).

Clicking on that link will give you access to the Application Dashboard, the Upgrade
Application wizard and many other features. On that page, on the right-hand side, you'll
see Page Specific Utilities.

Clicking on the "Cross Page Utilities" link will give you the links for grouping pages or
bulk editing them (a feature I use a lot too, to rename my pages, for example).

So, the grouping feature is a bit more tucked away in APEX 4.0, but then you get a more
logical grouping of features you can do.

Friday, October 08, 2010

In APEX 4.0 there's a new Tree Region. It's really cool and a lot better than the previous
tree in APEX 3.x.
When you navigate throughout this tree there is no submit anymore, it also looks a lot
The only catch is that the query is not that straightforward.

If you look under the query, you'll see the explanation what columns the query should
have, etc. Be careful, as the example below is missing the level column!

Anyway, check out the tree, it's definitely something that people seem to like.

Saturday, November 20, 2010
Just a quick note to say that there's a new patch for Oracle Application Express that fixes
a number of issues and also adds some enhancements to APEX (e.g. two new themes,
API additions to APEX_UTIL, etc.)
To download and read more about the patch set, Joel Kallman from the APEX
Development team wrote a good blog post about it.
Thumbs up for the APEX Development team for giving us these nice additions and the

Wednesday, November 17, 2010
The APEX Development team updated the Statement of Direction for the future releases
of Oracle Application Express.
As we can read on that page, Oracle Application Express 4.1 will focus on enhancement
to existing functionality and additional capabilities to support applications running on
mobile devices. Application Express 4.1 is planned to incorporate the following:
• Development for Mobile Applications – Include themes and HTML templates
suitable for smart phones and mobile devices.
• Charting – Provide for chart rendering without using Flash (to enable display on
mobile devices).
• Error Handling – Improve error handling and user-defined exception
• Interactive Reporting – Allow multiple reports on one page and support pivot
• Tabular Forms – Allow multiple tabular forms on one page and continue to
expand tabular forms validations.
• Master-Detail-Detail – Allow the generation of pages to support master-detail-
detail relationships.
• Dynamic Actions – Enhance conditional processing and allow Dynamic Actions
to be defined for tabular forms, reports, and buttons.
• Plugins – Add plugin support for additional components and enhance plugin
• Use of ROWID – Allow usage of ROWID for Automatic DML processing (as an
alternative to identifying the PK columns).
• Modal Dialog – Add ability to display a dialog on top of a page (the rest of the
page will be grayed out).
• Websheets – Allow for greater control over user interface, new page section
types, and enhanced spreadsheet / datagrid integration.
• Data Upload – Enable end-users to upload data into an existing table (within an
• Accessibility – Improve accessibility in existing themes and HTML templates.
• Numerous functional and performance improvements.

Great features I would say! For many of the above items we work around them with some
handwritten coding. As many of you know, I'm a heavy supporter of charts and
dashboards and we've already been working on a non-Flash-based charting engine for the
current release of APEX.
This solution I actually showed at Oracle Open World, too. We plan to release these non-
Flash based charts soon too, so if you are on APEX 4.0 and you don't want to wait till 4.1
or later, no worries, something is coming ;-)

Oracle tools
from Red Gate Software

All information and prices correct at the time of going to print.

For the latest information and pricing on all Red Gate's tools,
The Deployment Suite for Oracle
Better, faster, more accurate deployment

 Eliminate mistakes deploying Oracle database changes from dev, to test, to production
 Troubleshoot and fix errors caused by differences in Oracle database schemas and data
 Generate SQL scripts to migrate table contents from one database to another
 Automate schema deployments using the command line tool
 Eliminate tedious and time-consuming manual tasks by automatically generating documentation
 Satisfy audit requirements by keeping complete documentation
 Supports Oracle 9i, 10g, 11g

The Deployment Suite for Oracle contains:

 Schema Compare for Oracle
Compares and deploys Oracle database schemas

 Data Compare for Oracle

Compares and migrates Oracle database contents

 Schema Doc for Oracle 1.0 (due for release Q2 2011)

Automatically generate Oracle database documentation.

"One word...WOW!!!! Exactly what I'm

looking for. With multiple developers
posting changes into a dev database,
this allows me to generate a script to
sync up and compare the two schemas.
Works like a charm."
Al Drozd Senior Application Developer,
Hewlett Packard

Visit for a 14-day, free trial of all our Oracle tools
Apex Evangelists
Apex Evangelists

APEX Evangelists provides real world Oracle Application Express Solutions, Consulting
and Training for clients using our team of highly trained and qualified Oracle specialists
from around the world, each of whom is an expert in web development using Oracle
Application Express.

We strongly believe that only by working with the best people can you deliver the
best solutions. By working with the APEX Evangelists team you will receive a secure,
professionally designed Oracle Application Express solution that not only fits your
requirements today but will also scale as you grow.

Whether you're a small company on a tight budget, or a large multi-national

corporation looking for a rapid turnaround, APEX Evangelists can provide the right
Oracle Application Express solution for you.