Inside Oracle APEX by Patrick Wolf

Incomplete/Broken HTML output

A few days ago an ApexLib user from Norway contacted me and told me that the framework doesn't work and he is getting JavaScript errors.

I looked at the provided HTML output and I was scratching my head, because the output looked really strange and I couldn't really come of with a good reason why the JavaScript code was broken. Another wired thing was that it worked sometimes for the page and sometimes not, the error was depending on the data which was displayed!
apexlib.field.addField("P4_REGION_ID", [...]
apexlib.field.ddField("P4_COUNTRY_ID", [...]

In the above example, the "a" of addField was missing, but in the previous statement it was there. So no programming error.

After some investigation I found the thread strange things happening: broken html in output on the OTN Forum.

Arie gave me a good tip and as soon as the patch was installed, everything worked as expected.

I write this blog posting, because yesterday I read that another user on the OTN forum had the same problem and I suspect that most users ignore the post installation steps of the APEX installation. So that's a good chance to verify if you have installed the "PL/SQL Web Tookit Patch". That can save you a lot of time looking for an error which isn't really one.

Labels: , , ,


« ... Read full posting ... »

Nicer URL for an Oracle APEX application

There are several articles out on the net which cover nicer URLs for Oracle APEX applications.

This posting is just an overview of some of them, because I just came across a new blog posting for that topic and it's an often asked question when you are going to deploy your new APEX application.

There are two methods I know of to get nicer URLs.
  1. Use the Apache mod_rewrite module. The following links are a few articles covering that
  2. Use HTML Frames. The following code would be an example for that
    <html>
    <head>
    <title>Some Title</title>
    </head>
    <frameset rows="100%,*" border="0">
    <frame src="http://your_host/pls/otn/f?p=xxxxx" frameborder="0" />
    <frame frameborder="0" noresize />
    </frameset>
    </html>

Labels: , , ,


« ... Read full posting ... »

Oracle APEX 3.0 close to completion?

Is the APEX 3.0 development already close to completion?

If you read some of the development responses in the APEX 3.0 Feedback application

[...] I have logged a bug but it won't be fixed for 3.0 because we have already sent our translations out and even though this would not be a new string [...]

it really looks like that they are coming into a state where they don't do any fundamental changes anymore.

But I'm sure the APEX development is happy if you help them find bugs in the new features so that APEX 3.0 is a really stable development environment when it gets released. Or as Carl would say it

I'm sure he'd be thrilled to get bug reports and feature requests who doesn't want more work?

So get your b... up, logon to the evaluation instance of APEX 3.0 and do a shake down test of the new features! Together we can help them to create a stable new release with a lot of nice new features!

For all the existing testers, to my knowledge the evaluation instance has been refreshed on Feb. 20. So check out what has already been fixed!

Labels: , ,


« ... Read full posting ... »

APEX Training days at ODTUG - Kaleidoscope 2007

Scott Spendolini just has published the abstracts for the APEX Training held during ODTUG Kaleidoscope 2007.

There are some topics on the agenda which really look interesting.

You should really consider going there, because there are also some interesting presentations on the ODTUG Conference agenda as well.

My last ODTUG conference I attended was back 2001 in San Diego, man that's already a long time ago! At that time I was much younger... :-)

Labels: , , ,


« ... Read full posting ... »

Denes has released an unwrapped version of his Flash Charting solution

sexy_chartingSome time ago I blogged about replacing the SVG APEX charting with a Flash charting solution which is more "sexy" than the SVG charts.

The drawback of the solution was that the package which you had to use was wrapped. But the good news is that Denes Kubicek has just released an

unwrapped version of the package.

So get it and try it out. Details and questions can be asked in the related OTN forum thread.

Denes, keep up the good work! We need more out-of-the-box APEX open source solutions!

Labels: , ,


« ... Read full posting ... »

Hacking the APEX Builder - Part 3

On Wednesday I released the first version of the APEX Builder Plugin, on Thursday I added a small enhancement, but on Friday I had an idea how to really increase the productivity of the Oracle APEX IDE.

People who know me, know that I'm restless and just think about that as long as I haven't implemented it. :-) So I spend some hours of my weekend to enhance my APEX Builder Plugin.

So what excited me that much that I spend another weekend doing some programming?

Based on my UI style guide I always have to change a lot of attributes for my Page Items/Tabular Form Columns/... when I create a new page/item/tabular form.

For Example:
  • Labels: I don't like the wizard generated label template "... with Help", I want to have them left align and they should have a colon at the end of the label.
  • Date picker: I have to set "Display As" to the correct format mask, set the Width and the Max Length attribute to some fixed values.
  • Money: I have to set "Display As" to text, set a format mask, set "HTML Form Element Attributes" to style="text-align:right;", because I want to have to have numeric items right aligned.
  • Have to remember all the hints which I can use with my ApexLib Framework
  • ...
So many things to remember and so many unproductive steps just to get a consistent user interface. And what about if you have a group of developers, how to help them to enforce the same user interface style guide through the hole application?

That's where the new Set select list comes into the game, which is seamlessly integrated into the Oracle APEX IDE!

Watch the video demonstrating the new "Set" feature.

The select list is fully configurable and can be adapt to your needs. The HowToInstall.html contains instructions how to change the select list. I have also created another video which shows how to use the Firebug add-on to identify the field id's.

So get the APEX Builder Plugin now and increase your productivity!


Labels: , , ,


« ... Read full posting ... »

Hacking the APEX Builder - Part 2

Just updated the APEX Builder Plugin for Greasemonkey to version 1.1

Are you also setting "Export Comments" to YES each time when you export your Oracle APEX application, because you don't want to loose your developer comments in the case you have to restore from a previous export. How often have you forgotten and have been lucky that you didn't have to restore?

If you use the ApexLib Framework, the comment is event more important, because it stores meta-data required for the framework and trust me, you don't want to loose this information! :-)

In APEX 3.0 this has already been fixed, the default is now YES.

Until APEX 3.0 is release you can use my APEX Builder Plugin script for Greasemonkey, which will automatically set the "Export Comments" field to YES when you go onto the export page.
  1. Follow the steps in Hacking the APEX Builder - Part 1.
  2. If you have already installed the script, open Tools/Greasemonkey/Manage User Scripts... and uninstall the 1.0 version.
  3. Install the new version 1.1
  4. Verify that Version 1.1 is displayed in the install dialog, otherwise you may have to clear your browser cache.

Labels: , , , ,


« ... Read full posting ... »

Hacking the APEX Builder - Part 1

Last week I blogged about a resizeable textarea which can be integrated into an APEX application. I thought it would be cool to have this resizeable textareas in the APEX Builder, too.

How could that be done?

I think there are 3 possible solutions
  1. Add the code into the htmldb_get.js with some check that it only executes when the current application is 4000
  2. Implement it as a bookmarklet, but there are maybe size restrictions or
  3. implement it as script for the Firefox Add-on Greasemonkey.
I thought I give Greasemonkey a try, because it's non inversive and it will automatically execute the script as soon as the HTML page has been rendered. So sorry Internet Explorer users! But if you know a similar extension for IE, let me know and I will take a look.

The installation is quite simple, just follow these steps.
  1. Download and install the Greasemonkey add-on.
  2. After the installation you will see a little monkey face at the right bottom.
  3. Download my APEX Builder plugin script
  4. Install apex_builder_plugin.js (File/Open File)
  5. That's all, you are done. Login into APEX and try it out!
I have created a video, demonstrating this new feature. Watch it!


Labels: , , ,


« ... Read full posting ... »

ApexLib release 1.03 available

Did some bug fixing for the ApexLib Framework.

This release also solves the problem of navigable Date Picker/Lov icons when using Firefox. The framework now removes the "a href" of the icon from the DOM tree and assign the action of the link as onclick event to the icon. So no navigation problem with any browser anymore.

Does anybody use the framework with a pre-APEX 2.2 version and wants to have the non-navigable Date Picker/Lov icon feature? Because there is a pending bug for that which I only will implement if there is a demand for it.

The following other bugs have been fixed in this new release:

  • Bug# 1657465: Some date formats with a slash are handled incorrect
  • Bug# 1657820: Page Item which isn't assigned to a region raises ORA-20555
  • Bug# 1657853: HowTo Integrate: Error Handling example is wrong
  • Bug# 1658232: Error if $APEXLIB_MAX_LENGTH=xx$ is not first hint
  • Bug# 1658232: setLRButtonIconsNonNavigable doesn't work for all themes
  • Bug# 1655635: FF: Date Picker/Lov icon is navigable after click onto icon
  • Bug# 1630138: Error on error page sometimes visible for a blink
  • Bug# 1655630: jQuery doesn't work with Safari

Upgrade instructions:

  • Follow the revised steps in the How To Integrate document.
  • Chapter 1 "Database installation": Call the install scripts or manually install the the changed packages/views.
  • Chapter 3 "Integration into your Application", point 3 (ApexLib - Before footer): ApexLib_Browser.setLRButtonIconsNonNavigable has new parameters
  • Chapter 3 "Integration into your Application", point 4 (ApexLib - Handle Error Page): apexlib.error.DISPLAY_LOCATION referenced a wrong constant
  • Chapter 3 "Integration into your Application", point 10 (Error Page Template Control section): replace with new HTML code

Files added/changed:


Labels: , ,


« ... Read full posting ... »

Setting a "Case Restriction" for Page Items/Tabular Form Columns

That's the last posting about new features in the 1.02 release of the ApexLib Framework.

Ever wanted to set a case restriction (uppercase/lowercase/capitalize) for a field like you can do it in Oracle*Forms with the "Case Restriction" property?

Here you go!

There are three new ApexLib hints called
  • $APEXLIB_UPPERCASE$
  • $APEXLIB_LOWERCASE$
  • $APEXLIB_CAPITALIZE$
which can be set in the Page Item Comment or for Tabular Form Columns in the "Link Attributes" property.

If you set such a hint, the ApexLib Framework will automatically generate the necessary code for the browser and will also make sure that the values are stored with the correct case restriction when the page is submitted.

You can test this feature on the ApexLib Feature Demonstration site.


Labels: , , , ,


« ... Read full posting ... »

Hide "Select All" checkbox of row selector

In the last release of the ApexLib Framework I have also added a sometimes useful API to hide the "Select All" checkbox of the row selector of an Tabular Form. This can be useful to prevent the user from selecting all records for delete.

You just have to call
ApexLib_Browser.hideSelectAll;
in a page level process with the following settings:
  • Type: PL/SQL
  • Sequence: 1
  • Process Point: On Load - Before Footer
You can test this feature on the ApexLib Feature Demonstration site.


Labels: , , , ,


« ... Read full posting ... »

Restrict input length of Tabular Form columns

One problem with Tabular Form Column is that they don't have a "Maximum Width" property as Page Items do. APEX automatically generates a maxlength=2000 for all columns. What is the result? The user gets a


when he enters a too long value. Not really nice, isn't it? And now he has to start counting so that he knows where to cut of...

That's why I have added the new ApexLib hint $APEXLIB_MAX_LENGTH=length$ eg. $APEXLIB_MAX_LENGTH=40$ to restrict the enterable input length. The ApexLib Framework will automatically generate the necessary HTML attributes and also verify the length when the page is submitted.

This hint has to be set in the "Link Attributes" property of the Tabular Form column, as the other Tabular Form hints like $APEXLIB_REQUIRED$, ...

You can test this feature on the ApexLib Feature Demonstration site.


Labels: , , , , ,


« ... Read full posting ... »

My new "Chefsessel" (Not APEX related)

Yesterday I bought a new chair for my home office, a so called "Chefsessel". A word by word translation would be "Chief chair", but I think it's called "Manager chair" in English.

With the old chair my back really hurt after some time. Maybe I'm getting old, or it was just the chair...

I have to confess that my desk normally doesn't look that tidy, I have cleaned it up before taking the picture. :-)

Ok, if I'm now sitting on a "Chefsessel", can I call me now a "Chief developer"???

« ... Read full posting ... »

Integrating Yahoo Pipes into APEX

Maybe you have already read about Yahoo Pipes which you can use to build your own mashups.

Today, I did a quick test. It has a nice Web/JavaScript interface and is really easy to use. After I finished my first "Pipe" I thought about how to integrate the output into Oracle APEX.

It isn't really hard to do that, because the Oracle database has already everything build in to accomplish that.

1. Create your own pipe

I created one which gets different RSS feeds, translates them with Babelfish into German and filters all which have the keyword APEX in the text. The German into which it is translating doesn't really make sens, but that's a other story... :-)

2. Run your pipe

Run your pipe (you don't have to publish it) and look for "Tools: Get as RSS" at the bottom of the page. Get the URL, eg it looks like http://pipes.yahoo.com/pipes/0HpUBCq52xGdaeRPfOgC8A/run?_render=rss

3. Create a report in APEX

Create a SQL based report with the following SQL statement.
SELECT EXTRACTVALUE(VALUE(ITEM), '/item/link')  AS LINK
, EXTRACTVALUE(VALUE(ITEM), '/item/title') AS TITLE
, TO_DATE
( SUBSTR(EXTRACTVALUE(VALUE(ITEM), '/item/pubDate'), 6, 20)
, 'DD Mon YYYY HH24:MI:SS'
) AS PUBLISH_DATE
FROM TABLE
( XMLSEQUENCE
( EXTRACT
( HTTPURITYPE('http://pipes.yahoo.com/pipes/0HpUBCq52xGdaeRPfOgC8A/run?_render=rss').getXML()
, '/rss/channel/item'
)
)
) ITEM
ORDER BY 3 DESC NULLS LAST

Replace the URL with your stored URL

About the SQL Statement:

The Oracle build-in HTTPURITYPE is really powerful, it will retrieve the content of an URL and if you specify getXML, automatically convert the XML output into an Oracle XMLTYPE. As soon as it is a XMLTYPE you can use all the XML build-ins to extract the data from the XML stream.

More info about HTTPURITYPE can be found at Carsten Czarski's blog (in German).

4. Run your APEX report



Labels: , , ,


« ... Read full posting ... »

Tabular Form record navigation with Up/Down key

I have added another small usability enhancement to the ApexLib Framework.

When you call the API
ApexLib_Browser.checkForUpDownKey;
it will register the keys Up and Down to navigate to the previous/next record in a Tabular Form. This should work for manually build (with Apex_Item) and also for the default updateable Tabular Forms.

It is by intention that the Up/Down key doesn't work on textareas and select lists, because on that type of field the Up/Down is used by the widget.

Try it out on the ApexLib Feature Demonstration site.

.

Labels: , , , ,


« ... Read full posting ... »

Non navigable Date Picker-/Lov/Image Button Icons

I still remember my "usability experience" when I first tried out Oracle APEX and created a form with a Date Picker and a Lov and run the page afterwards.

I had to click tab twice to go from a Date Picker or Lov item to the next item, because the Icon next to the field got the focus.

I was scratching my head and thinking, "Is that the Web-Experience and the easy of use, every manager and Java/JSP/JSF/PHP/... developer is talking about?".

With that kind of usability should I really throw away our rich-Web-client Oracle*Forms and give the users that kind of interface which they have to use each day long to enter data into the system?

On the OTN forum I read that some are using the HTML tabindex property for each field to get the desired behavior that the icons are skipped, but that's a lot of work...

That's where a new functionality of the ApexLib Framework comes into play.

With the new APIs
  • ApexLib_Browser.setLovIconsNonNavigable
  • ApexLib_Browser.setLRButtonIconsNonNavigable

it's possible to disable the Date Picker/Lov Icons and for Image generated Buttons the left and the right link. Maybe you have already noticed that you have to press 3 times tab to navigate to the next button...

The API
  • ApexLib_Browser.checkForLovKey
registers the key combination "Alt+Down" or "Apple+Down" for each Date Picker/Lov field to be able to open the popup with a key combination as the users from an Oracle*Forms environment are used to.

Try this new enhancements at the ApexLib Feature Demonstration site.

It should work at least with IE 6.0 and FF 2.0. There is only one behavior with Firefox which I haven't solved yet, when you click the Date Picker item with the mouse, the ApexLib framework set the focus onto the attached field. When the user now presses tab, it sometimes happens that the Date Picker/Lov icon get's the focus! Maybe someone has a solution for that.

Please let me know if it also works with other browsers. Thanks!

Labels: , , , , ,


« ... Read full posting ... »

SQL based String Tokenizer - another approach using CONNECT BY

Just read a nice SQL puzzle on the AMIS blog called Writing a pure SQL based String Tokenizer and because Lucas wrote
Please share with me your thoughts on this - but I will share my attempt with you anyway

That's why I thought I have to train my brain a little bit with a nice SQL statement... and here is my result using CONNECT BY instead of CUBE.

SELECT LEVEL
, SUBSTR
( STRING_TO_TOKENIZE
, DECODE(LEVEL, 1, 1, INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL-1)+1)
, INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL) -
DECODE(LEVEL, 1, 1, INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL-1)+1)
)
FROM ( SELECT '&String_To_Tokenize'||'&Delimiter' AS STRING_TO_TOKENIZE
, '&Delimiter' AS DELIMITER
FROM DUAL
)
CONNECT BY INSTR(STRING_TO_TOKENIZE, DELIMITER, 1, LEVEL)>0
ORDER BY LEVEL ASC
;

Does anybody have another solution to solve this SQL puzzle with pure SQL?

Labels:


« ... Read full posting ... »