Oracle Forms File drag and drop javaBean

I created a JavaBean that implements a “dropbox” in Oracle Forms.
It can be downoaded from the PJC/JavaBean library of Francois Degrelle.

When dropping one or more files on it, Forms receives the path and filename of it.
In the following example video the JavaBean is used to upload a file to the database.
For the uploading part I used Webutil.

 

 

Oracle Open World, build your schedule

As Oracle Open World is coming closer, it’s time to build your schedule…
Be prepared because there are so many choices.

So, here are some presentations I’m interested in and planning to attend.

Of course there’s my own presentation on monday.

  • Session: What’s Your Choice for Oracle Forms: Modernize, Upgrade, Integrate, or Migrate? (session id 08262)
  • Time and place: Monday, 12:30 PM, Marriott Marquis – Golden Gate A

When you are a developer working with Oracle Forms or an IT manager and have an Oracle Forms application, this is probably the session you should attend when you have questions about the future of Oracle Forms.
Together with Grant Ronald(Group Product Manager in Oracle’s Application Development Tools Division) we’re going to show you the possibilities of Oracle Forms in the future, not only with a presentation, but also with customer cases and demos.

What else is interesting on OOW:

  • ADF Enterprise Methodology Group (EMG) Sunday: 6 tracks about one subject: ADF
  • Presentations by Grant Ronald: starting with ADF?  Check his sessions and look how “easy” you can develop in ADF.
  • Four Ways to Transition from Oracle Forms to Oracle ADF by Wilfred van der Deijl(Monday, 03:30 PM, Marriott Marquis – Golden Gate A)
  • Reaching Out from PL/SQL by Lucas Jellema(Tuesday, 10:15 AM, Marriott Marquis – Salon 7)
  • Spend Some Quality Time on Your Oracle ADF Application by Aino Andriessen(Thursday, 12:00 PM, Marriott Marquis – Golden Gate A)
  • More interested in database(programming)?  Tom Kyte and Steven Feuerstein are “must see” presenters.

Get triggering element in dynamic action

Last week, I ran into a problem with a dynamic action in APEX 4.0.

I have a series of 8 images of persons which I generate with PL/SQL. They are all speakers on a conference. Every image is clickable and should insert the name of the speaker in the database.

I gave a class “speaker” to every image. The ID of the image is the primary key of the person in our database. By doing this, I am able to create a dynamic action which I can bind to the JQuery selector ".speaker".

In this case, I wanted to use AJAX to perform my actions so I created an AJAX callback insert_speaker which contained the PL/SQL block with the insert command. Based on the PK of the person, the name of the speaker will be inserted into the database, together with some extra information.

In my dynamic action, I added a true action of type "Execute JavaScript code". Here, I ran into a problem: how do I get the ID of the image the user clicked on?

On the internet, I found two solutions with JQuery to get the ID of the triggering element of an event:

$(this).attr("id");

and

event.target.id;

There is a little difference between these two, found it out here, so I tested both and concluded I needed event.target.id.

I completed the JavaScript block with the AJAX request, the ID parameter and the other lines and tested the page.
Everything worked perfectly. Well done, I tought...
...untill I tested my page with Mozilla Firefox. Firebug returned an error 'event is not defined'.

Hmm...and it all worked fine in Google Chrome (I use this browser for application development)? Strange.
After a while of searching, I figured out there is another solution, something specific to APEX:

this.triggeringElement.id;

Sounds logical, but it isn't when you have no idea this line can be used in APEX.

The only official documentation I could find about this, is the help text of the textarea labeled "Value" in the When block of a dynamic action.
Help text

When I changed

event.target.id;

to

this.triggeringElement.id;

in my code, the page works fine in both Google Chrome and Mozilla Firefox.

For further development with APEX 4.0: make sure you test your pages in multiple browsers!
The example above states  very well that not all browsers interpret code the same way!

Oracle Forms 11g and Google maps integration

In last years blog post about Forms 11g Javascript integration I explained how you could call the Google Maps API from forms using JavaScript.

I captured that testcase using screentoaster.
It seems that this tool has disappeared and all the recorded sessions with it.

So, here’s a new video on youtube of this Google Map Integration, now in a demo application.
The Form is embedded in a HTML page witch contains a Google Map.