APEX and AJAX – Where to Start. June 2010 Tim St. Hilaire. Story – Why I Love ODTUG. Introduction. We will walk through a series of examples that achieve the basic components of dynamic actions within APEX Partial Page Refresh reports Calling On Demand Processes
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Tim St. Hilaire
We will walk through a series of examples that achieve the basic components of dynamic actions within APEX
Initialize the Object
Calling the Refresh
You may have noticed, in the last example, that the On-Demand Process used an undeclared type of variable.
How could these names be improved?
The flow used in the example shown is as follows:
On Demand Process
AJAX – Report Refresh
Using similar logic, the same can be accomplished using Dynamic Actions
Action Binding - Preparations
In order to get the event to BIND to each row, a jQuery selector will be used. In order to easily identify the rows, a CLASS is applied to the LINK attribute. (Thanks Dimitri Gielis)
An aditional attribute (my_attribute) is also added to the link. This will be used for easy and consistent retrieval of the value needed for PL/SQL to act on
The binding of the Dynamic Action is using the Selection Type of jQuery Selector
This allows the use of the simple dot syntax to reference all DOM elements with the class “bind_to_me_for_delete”
Special Note – because the region for “removals” is dynamically refreshed per the design, the data bindings to the “removal” Dynamic Action needs to be classified as LIVE. The default of BIND will cause the bindings to be lost when the region is refreshed the first time.
Note: This is NOT in session state, only on the client.
The APEX Framework places wrappers on the Dynamic Action bind objects
This provides additional details and functionality for use.
This enables the code: $(this.triggeringElement).attr('my_attribute');
(Thank you Patrick Wolf)
Like the on demand processes at the application level, PL/SQL packages can be called using session parameters.
The “Items to Submit” sets the session state on the server prior to executing the PL/SQL code. (as explicitly done in the previous example)
On Demand processes are not the easiest thing to debug…
Using the NET feature of Firebug makes the job much easier:
I want my HTML to go here
Two settings helped make this example work
Many thanks to all those that have come before me, and for those that take the time to help others grow and improve their skills by sharing their time an knowledge.
Updated and corrected presentation will be available on my blog
http://apex.oracle.com/pls/otn/f?p=226 – This example application
Tim St. Hilaire - firstname.lastname@example.org