What are plug-ins & How to create plug-ins in Oracle APEX?
What are plug-ins?
A plug-in is nothing but an extension to the built-in types available in APEX. The types of plug-ins in the oracle APEX are authentication scheme, authorization scheme, item, region, dynamic action, and process types.
A Developer can create or download & import a plug-in developed and publish by a developer on apex-world. A developer can create plug-in from scratch or as copy of an existing plug-in.
How to create plug-ins in Oracle APEX?
here is an example of creating a simple APEX plugin that adds a button to a page and redirects to the previous page when the button is clicked:
- JS File :
IMAGE-01
- Create a js file with name "historyback.js" with code in IMAGE-01.
- Redirect to Shared Components > Files and Reports > Static Application Files.
- Click on create file & drag and drop "historyback.js".
- Then click on "Create".
- Plug-in :
- Create a new plugin in the APEX builder by going to Shared Components > Other Components > Plug-ins.
- Enter name, for example, "Back".
- Enter "Internal Name".
- Select Type as "Dynamic Action".
- Select Category as "Navigation".
- Add below code in PL/SQL source code from IMAGE-02.

IMAGE-02
6. Add PL/SQL function/procedure name in Render Procedure/Function Name.
7. Select the affecting Item by selecting one of the attributes from "
8. Mention plugin version in Information > Version.
9. Click on "Create Plug-in"
- Code :-
- JS code :-
function historyback(){window.history.back()}
- Pl/SQL code :-
function history_back (p_dynamic_action in apex_plugin.t_dynamic_action,p_plugin in apex_plugin.t_plugin )return apex_plugin.t_dynamic_action_render_resultisl_result apex_plugin.t_dynamic_action_render_result;begin-- Add the .js fileapex_javascript.add_library (p_name => 'historyback', -- Name of the Javascript file without .js extensionp_directory => '#APP_IMAGES#', -- Path where this file is uploaded, in this case its inside Apex application directoryp_version => null );-- Assign the function to be usedl_result.javascript_function := 'historyback'; -- Javascript function name present inside your file to be used herereturn l_result;end history_back;
To summarize plug-ins are great way of reusing your object and share it with the community on apex-world
Comments
Post a Comment