Inside Oracle APEX by Patrick Wolf

Early access release of Application Express 3.0 available!

Just saw it on my Google Reader and I thought I have to immediately post this news.

It seems that the APEX team has released an Early access release of Application Express 3.0!

Check it out and give them feedback!

Enough for now, I have to get me registered! :-)

Labels: ,


« ... Read full posting ... »

Using Google Account for APEX authentication

Google AccountRead a very interesting posting on Przemek Piotrowski blog about using the Google Account credentials for an APEX application login.

The method described uses the Google Account Client Login API for verifying the user.

More details at Application Express user authentication using Google Account.

I think that's a good example of the flexibility of APEX to adapt to the different needs of an application.

Labels: , ,


« ... Read full posting ... »

Setting SYSDATE to a fixed value

Dietmar Aust just blogged about a very interesting trick to modify SYSDATE which I didn't know so far.

As he writes in his posting this can be very useful for testing if you have to do some time traveling...

In our company we used a different approach by writing a setSYSDATE and getSYSDATE method which has to be used instead of SYSDATE. But the trick to just set
ALTER SYSTEM SET fixed_date = '2007-01-27-11:50:00';
is much easier and also works if a developer has used SYSDATE. For details and what other commands you have to issue, check out Dietmar's posting.

Labels: ,


« ... Read full posting ... »

Got an "ORA-06502: numeric or value error" during installation of APEX 2.2.x?

I ran into this Oracle APEX installation problem a few months ago and just got a call from one of our customers hitting the same problem. So I thought it might be a good idea to share the reason and the workaround for that problem.

Does your installation log files contain the following errors?
Error creating button name="REFRESH" id="181590632003554484" ORA-06502: PL/SQL:
numeric or value error: character string buffer too small
ORA-06512: at
"FLOWS_020200.WWV_BIU_STEP_BUTTONS", line 24
ORA-04088: error during execution
or
Error page=190 item="F4000_P190_QUICKPICK" id="5224728991502726"               
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 323
ORA-06512: at "SYS.HTP", line 860
ORA-06512: at "SYS.HTP", line 975
ORA-06512: at "SYS.HTP", line 993
ORA-06512: at "FLOWS_020200.WWV_FLOW_API", line 4005
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "FLOWS_020200.WWV_BIU_STEP_ITEMS", line 63
ORA-04088: error during execution of trigger 'FLOWS_020200.WWV_BIU_STEP_ITEMS'
ORA-06512: at line 4
I'm pretty sure that your database parameter NLS_LENGTH_SEMANTICS is set to CHAR.

Workaround

In your SQL*Plus session execute
ALTER SESSION SET NLS_LENGTH_SEMANTICS=BYTE;
before you run the APEX installation scripts.

See also the related OTN thread Version 2.2 installation fails.

Labels: ,


« ... Read full posting ... »

I finally made it...

Today at 00:50 (when normal people are already sleeping) I finally made it to release version 1.0 of the Oracle APEX development framework, called ApexLib.

Today I was the hole day at a customer and had no chance to blog about it. So I was really surprised than when I came home and checked my Google Reader, John Scott was faster than me, because he had already blogged about my framework. Thanks John for your nice posting!

Maybe you have noticed the version jump from v0.17 to v1.0, but I thought after implementing Browser Validation for Tabular Forms and new installation scripts, it was time to go to version 1.0. And to be honest, with the old numbering it would have taken forever before 1.0 would have been reached :-)

So what's in this new release?

As you can see from the following list, there are some enhancements and some bug corrections.
  • CR# 1634286: Client side validation for tabular form
  • CR# 1635730: Possibility to install ApexLib into it's own schema
  • CR# 1638777: Add an uninstall script
  • CR# 1636235: Only transfer label template metadata if used
  • Bug# 1640936: Check for dates which contain 08 or 09 fails
  • Bug# 1635198: Two digit year is always prefixed with 19
  • Bug# 1635376: setNlsData raises "ORA-06502: Numeric or value error"
First of all, the browser validation has been enhanced to check Tabular Forms too.

The second big change is the installation process, I have written a new HTML installation How-To, which I think is better readable than the previous text version and it's now possible to install the ApexLib Framework into it's own database schema (eg. APEXLIB), so that you don't have to mess the FLOWS_xxx schema anymore. It even contains an uninstall script, in the case the framework isn't what you have been looking for.

If you have already used the framework, I would suggest that you run the uninstall script and do a fresh installation.

If you want to test the Tabular Form Browser Validation, check out the demo site!

Want to know more about the ApexLib Framework, checkout the following links:
In the next few days I will write a posting about how to just use some features of the framework, in the case you don't want to use all the features.

Any suggestions, improvements, "must haves" for the framework are very welcome! But also "negative" feedback is very welcome. Eg. if it doesn't work for you or why you can't use the framework, ... I would like to use this feedback to improve the framework.

Thanks
Patrick

Labels: , ,


« ... Read full posting ... »

UKOUG is looking for input for a special event dedicated to APEX

Jonathan Lewis just posted an announcement on this blog, that the UKOUG is thinking about a special event (one-day) dedicated to APEX.

They are looking for ideas from the user community about whether this would be a useful event, what sort of things they would like to hear about, the type of event they would want, and the degree of support.

Check out his posting UKOUG - Apex and give him some feedback!!!

Labels:


« ... Read full posting ... »

Oracle is looking for 11g Beta tester

Just got a newsletter from Oracle with an article that they are looking for Beta tester for the upcoming Oracle 11g Database release.

Check out Oracle Database 11g Beta Program Underway.

Labels:


« ... Read full posting ... »

Amnesty for production applications on apex.oracle.com

Maybe you have already heard of Jes (John Scott) who is running Shellprompt Hosting, a company which offers APEX internet hosting.

They are currently offering an APEX amnesty for production applications which are running on apex.oracle.com. Maybe you want to check out.

Labels: ,


« ... Read full posting ... »

Accessing Tabular Form cell with JavaScript

Today there was a thread on the OTN forum about how to access a Tabular Form cell with JavaScript and I thought it might be of general interest.

Scenario

You have a Tabular Form with 3 columns (Amount, Tax, Total) and want to populate the Total column with the sum of Amount and Tax as soon as Tax has been entered.

Solution?

For "normal" page items there are lot of solutions on the OTN forum, where you just use
html_GetElement('P1_TOTAL').value =
parseInt(html_GetElement('P1_AMOUNT').value, 10) +
parseInt(html_GetElement('P1_TAX').value, 10);
But how does it work for Tabular Forms? Quite similar!

Add the following JavaScript code into the
  1. Page HTML Header property:
    <script type="text/javascript">
    function calculateTotal(pThis)
    {
    var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    html_GetElement('f03_'+vRow).value =
    parseInt(html_GetElement('f01_'+vRow).value, 10) +
    parseInt(html_GetElement('f02_'+vRow).value, 10);
    }
    </script>
  2. Tabular Form Element/Element Attributes property of the TAX column:
    onchange="calculateTotal(this);"
f01, f02 and f03 (case sensitive!) in the JavaScript code has to replaced by the field ids APEX is using to reference the tabular form column. The are equal to the numbering of the Apex_Application.g_fxx arrays.

The easiest way to get them is to view the HTML source APEX generates, or use tools like FireBug - use the Inspect feature.

Happy JavaScripting!

Labels: , , , ,


« ... Read full posting ... »

Integration of Google Maps, Oracle Maps, ... into APEX

I thought it's a good idea to have an overview of all the different "How-To integrate ... Maps into APEX" postings out here. Should make it easier for you if you are new to this topic to find the relevant pieces.

If I have missed an interesting posting, please let me know!

Google Maps

Oracle Maps

Others

Labels: , ,


« ... Read full posting ... »

Tabular Form alignment with page items

There was a question on the OTN forum about alignment of page items which should look like a tabular form. I thought it might be of general interest, so I created a short posting about it.

As you can see from the posting, the person asking tried several different settings, but got gaps between the fields or they where not aligned as desired.

There is a trick to avoid this gaps, use the following settings:
  • Remove what's in the label
  • Horizontal / Vertical Alignment = Above
  • Template = - select a template -
This will not generate any label information. No gap is generated as it is done when you select "No Label".

The following image shows how it looks like with Label Template set to "No Label".

Labels: , ,


« ... Read full posting ... »

Firebug - must have for JavaScript/Web developers

If you are a JavaScript developer or create your web-pages with CSS, then the Firefox add-on Firebug is a must have for you!

There is a new beta available, with lot of features, compared to the one hosted by the Firefox extension web-site.

Never heard of Firebug? Check out Dr. Dobb's - AJAX Debugging with Firebug, there is also a good feature overview on the Firebug web-site.

Two things I want to highlight:
  • The JavaScript debugger, with breakpoints (also conditional), variable watching, ...
  • The inspect feature, where you can click on any element on your HTML page and it will show you the DOM tree, the CSS infos, ...
  • But there so many more nice features, just look around...
Couldn't imagine doing my ApexLib Framework development without that tool!

Labels: ,


« ... Read full posting ... »

One small step for a man, one giant leap for mankind

Just kidding :-) I was just looking for an eye catcher...

Maybe you have already seen my announcement that I have released v0.17 of the ApexLib Framework, which contains a lot new features.

The previous features in the Framework mostly concentrated on improvements of Oracle APEX on the server, so that's easier to access Tabular Forms or do automatic validation of date picker or numeric items. The main idea was to make APEX applications more secure without having to do a lot of additional coding. Quoting from Securing Web Applications
The #1 rule that all web developers should never forget is "Don’t trust end-user data!". With this in mind, when designing html forms it is extremely important to have appropriate server-side validations for every field.
I will probably add more server-side checks on the server, just to make sure.

But my long term goal was always to bring more interactivity to the browser, without having to submit the page. The first step was the AJAX enabled Generic solution for cascading lovs, the next step is now

Out-of-the-box client side validation for required-, date picker- and numeric items

No additional JavaScript code has to be written to do that anymore, it's automatically generated and done by the ApexLib Framework.

Check out the example page!

What will you see there?
  • Immediate check of a required field as soon as you leave the field. It's a "soft" check which just shows an inline error message (no ugly alert boxes), informing the user that the field is required.
  • Immediate check of date and number fields if the entered value matches to the defined format mask. It's a "hard" check, at least on IE the cursor will stay in the field. IE isn't spec conform here, but in that case it's good that it isn't :-)
  • Date and number values are formated according to the format mask. Eg it will fill up the cents with 0 if you only have entered a full dollar amount, or it will add the currency sign (Oracle validation would fail if you don't enter the currency sign!) and so on.
  • As soon as you correct the error, the error message is removed so that the user gets a visual feedback that the error has been fixed.
  • All the checks are NLS aware, so if your database settings return the Euro sign or use a comma instead of the period for the decimal point, the library will handle that. It should also support all the different date format masks. Also the weird American ones with AM/PM and the month at be beginning... ;-)
  • When the user tries to submit the page, the above checks will be done again. If one of the checks fails the submit is aborted until the user corrects the error.
  • The library is aware of existing onchange/onblur events which are registered for the fields and executes them after its checks.
The rules if a required check is generated are the same as for Automatic required and date picker/format mask check for page items and Plug & play tabular form handling. Please help me finding browser issues (tested with Firefox 2.0 and some basic tests with IE 6.0). I also want to see if the format mask checks I implemented in Javascript work for all the combinations out there. And it the inline error display also works with other themes and userdefined label templates. So readers, please test and give me feedback!

Client Side JavaScript library

Man the JavaScript stuff was a lot of work, you really appreciate the build in TO_DATE and TO_NUMBER and it's flexibility when you have to implement that by yourself. At least I haven't found a JavaScript validation toolbox which is compatible with the format mask settings of Oracle.

I'm really new to JavaScript, just started 1 1/2 month ago and I'm currently on page 351 (total 994) of the JavaScript - The Definitive Guilde. So if you look at my code and think, man are you crazy, why you write that much code to do that, it's a simple regular expression and you are done! Please let me know! I have already done some refactoring of the ApexLib.js library, so that the code is stored in it's own namespace and I think the new modularization will be quite stable for some time. The structure of the server side packages should also be stable now.

Want to have this client side checks in your application?

Read the "How to integrate" posting I have done. That's all, the rest is done by the Framework.

Note: It's build that way that you can also apply it to an existing application. It will just enhance it.

Doesn't work as expected?

Please read the FAQ on the Automatic required and date picker/format mask check for page items postings for debugging and some basic tests. Still doesn't work? Send me an e-mail (can be found in my profile) or write an comment.

Roadmap for future development

Next step will be to do the same checks for tabular forms. After that I will try to add some more client side checks. Eg some of the validations which have been defined for the page.

Labels: , , , ,


« ... Read full posting ... »

ApexLib: New release v0.17

Just have uploaded release v0.17 of the ApexLib Framework. I will post about the new features a little bit later.

But you can already do a quick test drive of the new feature.

But for now, it contains the following enhancements/bugfixes:
  • CR# 1629399: Client side required check
  • CR# 1632976: Client Side number check
  • CR# 1623655: Client Side date validation for date picker
  • CR# 1623682: Remove error message when item/column cell has been changed
  • CR# 1629858: Refactor ApexLib.js and use namespaces
  • CR# 1629972: Create installation scripts
  • CR# 1632823: Provide a compressed version of ApexLib.js
  • Bug# 1630132: Inline Errors don't work for Labels which are Above/Below
  • Bug# 1628225: Validation occurs to early
  • Bug# 1631232: APEX 2.2.0.00.32: Error when installing into appl. schema

Changed behavior:

  • Most of the existing calls have changed, get the new code from "How to Integrate
  • APEXLIB_* (Shared Components/Text Messages) messages are now using the placeholder %label for labels. eg
    %label doesn't match to the format "%0" (eg %1).

Files added/changed:


Labels:


« ... Read full posting ... »

Doesn't that look cool? (Not APEX related)

AppleDoesn't this phone look cool? And if it really works that smooth and easy as it is demonstrated in the flash animation, I have to agree that they are really years ahead of Nokia, ...

I think I have to get a new phone this year :-) to bad that it will not be available in Europe before Q4/2007 :-(

« ... Read full posting ... »

Sergio's blog and some old postings

On weekend I was reading some of the old postings (years 2004, 2005, 2006) of Sergio's blog. I think there are lot useful tips and tricks you can get from this "old" postings, because they are still valid in Oracle APEX 2.2. So browse through his blog archive!

Just a few postings which I have bookmarkedBut there are a lot of others. There are also some old screenshots, it's really funny to see the old look and feel of APEX... :-)

Labels:


« ... Read full posting ... »

ApexLib: New release v0.16

Just have uploaded release v0.16 of the ApexLib Framework. The new release doesn't contain a new "big" feature, but I think the new enhancements are still useful.

The new procedure ApexLib_Error.addApexValidationErrors can be used to catch the errors raised by page validations and show them as inline error messages without having to re-render the page. How to use it?
  1. Create a new page level validation
    • Name: Show validation errors
    • Type: PL/SQL Error
    • Sequence: 99 (has to be the last validation!)
    • Validation Expression 1:
      ApexLib_Error.addApexValidationErrors;
    • Error Message: Error
    • Error message display location: Inline with Field and in Notification
  2. Try out the example page where I have created the following check for Hire Date
    ApexLib_Item.DV('P31_HIRE_DATE') <= TRUNC(SYSDATE)
    As you will see it's also displayed without having to re-render the page. That's maybe sometimes useful when you want to avoid that values in a tabular form are discarded because of re-rendering the page.

The known restriction, that items/column/regions which had an assigned authorization where ignored by the different checks, has been removed. The framework now checks if the user has the authoriziation.

Update 06-Jan-2007: There was an error in ApexLib_Region.pkb, I have uploaded an update of the release.

List of the covered enhancements by this release

  • CR# 1628158: Add functionality get the APEX validation error stack
  • CR# 1627230: Remove the restriction for items/regions/tabular forms with an authorization

Files added/changed:


Labels: ,


« ... Read full posting ... »