How To Create Plug Ins Oracle Apex2
How To Create Plug Ins Oracle Apex2
Hi Guys,
Recent Posts
In this post we will see how to create a Plugins in Oracle Apex. Well you might Referencing CSS file in
wonder why we need Plugins when we can use the native Apex application code Template section – Oracle
Apex
and its enriched set of features. Hmm, well I can think of one scenario where this Email Address Validation in
can be useful. Its “reusability” makes it more elegant and more simplistic. Let’s IG
Interactive Grid –
say you have implemented a functionality which requires some complex code Unsupported feature
involving many javascript code, adding libraries and so on, and you would like to RETURNING clause
IG common JS methods call
implement the same in another application. at one go
Looping through the records
of IG in PL/SQL – Changes
In this case, you can do the following:
also in Javascript API
1. Copy all the code/libraries from your application into the application you
would like this to be implemented. Archives
2. Create a Plugin, put your reusable code into that, export the plugin and import October 2022
it in your application. September 2022
August 2022
Well, as you can see the Solution 2 is elegant and simple!, so let’s dive ahead in December 2021
November 2021
creating a Plugin:
July 2021
June 2021
Let’s take the Use Case as follows : In Dynamic action, on Page load I would
May 2021
like to show the message “Hello World!” April 2021
February 2021
Step 1 : First Create a .js file which displays the alert “Hello World!” and save it as May 2020
April 2020
“HelloWorld.js” (Well any name of your wish)
February 2020
December 2019
function helloWorld()
September 2019
{ August 2019
alert("Hello World!"); January 2019
}
September 2018
July 2018
June 2018
Step 2 : Import that file in the Share Components -> Static Application Files of April 2016
your Apex application. July 2014
October 2013
September 2012
Step 3 : Go to Shared Components -> Plug-ins -> Create and select the option Categories
“From Scratch” and press “Next”
APEX
Baby products
Blood and Moonlight Series
Database
Django
Docker
Advertisements Dynamic Actions
Ebooks
HTML
Interactive Grid
REPORT THIS AD
Javascript
jQuery
Kate and O'Hare Series
Lux Series
Mortal Instruments Series
Novels Review
Oracle
Python
SQL
Talend
Technical
Step 4 : Give the following values in the “Name” section
Uncategorized
Meta
Register
Log in
Entries feed
Comments feed
WordPress.com
Name – This is the name of your Plug-in which will appear in the Dynamic Action
Internal Name – Its an unique name given across your entire application with
which Apex identifies Type – It is the component which uses this Plugin, in this
case its DA Category – It is an additional parameter which appears only for the
“DA” type, and here you specify at which instance this plugin needs to be called
upon
function hello_world (
p_dynamic_action in apex_plugin.t_dynamic_action,
p_plugin in apex_plugin.t_plugin )
return apex_plugin.t_dynamic_action_render_result
is
l_result apex_plugin.t_dynamic_action_render_result;
begin
-- Add the new .js file
apex_javascript.add_library (
p_name => 'HelloWorld', -- Name of the Javascript file without .js
extension
p_directory => '#APP_IMAGES#', -- Path where this file is uploaded, in
this case its inside Apex application directory
p_version => null );
-- Assign the function to be used
l_result.javascript_function := 'helloWorld'; -- Javascript function name
present inside your file to be used here
return l_result;
end hello_world;
Step 6 : Put the above function name in the “Render Procedure/ Function name”
section
Advertisements
That’s it, now press “Create” to create the Plug-in
REPORT THIS AD
Step 7 : Go to your page and create a Dynamic Action, give “When” event as “Page
Load”, now in the True action you should be able to see your plug-in present and
save it.
Now run this page, and you should be able to see “Hello World!” message
appearing!!!
Well, if you find this post useful please like this and feel free to comment when you
have questions!
Share this:
Loading...
Related
Calling javascript code stored in an Kanban Board in Oracle Apex Voice based deletion of data in
External File – Oracle Apex June 6, 2021 Oracle Apex
August 31, 2019 In "APEX" June 4, 2021
In "APEX" In "APEX"
APEX
Published by San
I am an IT professional with Oracle background, working in a renowned company. I have around 9+
years of working experience in Oracle Apex, PL/SQL. I also have some beginners experience in
Advertisements
REPORT THIS AD
Previous Next
Charts – Oracle Apex Voice based deletion of data in Oracle Apex
Leave a Reply
Enter your comment here...
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Blog at WordPress.com.
Advertisements
REPORT THIS AD