Forms 11g javascript integration: Call others

by

Forms 11g holds a lot of interesting new features focused on event-driven architecture, one of these is javascript integration. There are two ways of using javascript with Forms 11g: “call others” and “let others call you”.

Javascript can call code in Forms(“Let others call you”) using the new forms trigger “when-custom-javacript-event”.

This post is going to show you the first one: “call others”, in other words call javascript from your Oracle Forms application.

During the Forms Modernization Seminar I showed a google map that could be manipulated from an Oracle Form. It’s an easy implementation with only a few lines of code(most of the javascript is taken from the api examples on the google code site: http://code.google.com/apis/maps/).

  • Build a little form with one (control) block, one text field(to enter an address) and one button(to call the javascript code).
  • Next step is to create an HTML-page to display the form.

This code puts the form(in an iframe) and the map side by side:
(Click to enlarge)

And it will look like this:

  • The javascript that will be called is put in another file google.js:

  • The only thing to do is creating a “when-button-pressed” trigger in forms to call the javascript function showAddress.
    This is done by a new built-in procedure web.javascript_eval_expr:
  • Copy the HTML and javascript file to the following directory:
    <middleware_home>\user_projects\domains\<domain>\servers\WLS_FORMS\tmp\_WL_user\formsapp_11.1.1\e18uoi\war\
  • Create a new configuration using Enterprise Manager:

  • Make sure the parameter EnableJavascriptEvent is set to “true’ in your configuration!

And the working demo…

About these ads

Tags: , , , , ,

6 Responses to “Forms 11g javascript integration: Call others”

  1. Oracle Forms 11g and Apex using external events « iAdvise blog Says:

    [...] When changing the select list, the form is queried This is a solution to integrate forms into another application whether it’s Apex, ADF or another web applicaton. When it can put something on the queue, forms can react on it. And yes, I could do it using the javascript feature in Forms 11g. I know… And for Apex it’s probably a better solution, as we can skip the AQ part and make calls to and from forms in Javascript. [...]

  2. fa77 Says:

    demo is not available, please update it again…:)

    • poelger Says:

      Sorry about that. Seems like screentoaster doesn’t exist anymore.
      I dont’ have a back up of the recording, but I’ll look into another tool to put this back online.

      Gert

  3. vibin Says:

    FRM-92190 : Javascript is unable to evaluate expression, error is coming. what is the reason.

  4. Guru Says:

    Can you please share the html file javascript file you have used in this demo. Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: