Oracle APEX Plug-ins

Exclusive offer: get 50% off this eBook here
Oracle APEX 4.0 Cookbook

Oracle APEX 4.0 Cookbook — Save 50%

Over 80 great recipes to develop and deploy fast, secure, and modern web applications with Oracle Application Express 4.0 with this book and eBook

£22.99    £11.50
by Marcel Van Der Plas Michel Van Zoest | December 2010 | Enterprise Articles Oracle

Oracle Application Express 4.0 is a rapid web application development tool that works with the Oracle database. Using features like Plug-ins and Dynamic Actions, APEX helps you build applications with the latest techniques in AJAX and JavaScript.

In this article by Marcel van der Plas and Michel van Zoest, authors of the book Oracle APEX 4.0 Cookbook, we will cover:

  • Creating an item type plug-in
  • Creating a region type plug-in
  • Creating a dynamic action plug-in
  • Creating a process type plug-in

Oracle APEX 4.0 Cookbook

Oracle APEX 4.0 Cookbook

Over 80 great recipes to develop and deploy fast, secure, and modern web applications with Oracle Application Express 4.0

  • Create feature-rich web applications in APEX 4.0
  • Integrate third-party applications like Google Maps into APEX by using web services
  • Enhance APEX applications by using stylesheets, Plug-ins, Dynamic Actions, AJAX, JavaScript, BI Publisher, and jQuery
  • Hands-on examples to make the most out of the possibilities that APEX has to offer
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

 

        Read more about this book      

(For more resources on Oracle, see here.)

Introduction

In APEX 4.0, Oracle introduced the plug-in. A plug-in is an extension to the existing functionality of APEX. The idea behind plug-ins is to make life easier for developers. Plug-ins are reusable and can be exported and imported. In this way, it is possible to create functionality which is available to all APEX developers. It is also possible to install and use them without having knowledge of what is inside the plug-in.

APEX is actually a program that converts your settings from the APEX builder to HTML and JavaScript. For example, if you created a text item in the APEX builder, APEX converts this to the following code (simplified):

<input type="text" id="P12_NAME" name="P12_NAME" value="your name">

When you create an item type plug-in, you actually take over this conversion task of APEX and you generate the HTML and JavaScript code yourself by using PL/SQL procedures. That offers a lot of flexibility because now you can make this code generic so that it can be used for more items.

The same goes for region type plug-ins. A region is a container for forms, reports, and such. The region can be a div or a HTML table. By creating a region type plug-in, you create a region yourself with the possibility to add more functionality to the region.

There are four types of plug-in:

  • Item type plug-ins
  • Region type plug-ins
  • Dynamic action plug-ins
  • Process type plug-ins

In this article, we will discuss all four types of plug-in.

Creating an item type plug-in

In an item type plug-in you create an item with the possibility of extending its functionality. To demonstrate this, we will make a text field with a tooltip. This functionality is already available in APEX 4.0 by adding the following code to the HTML form element attributes text field in the Element section of the text field:

onmouseover="toolTip_enable(event,this,'A tooltip')"

But you have to do this for every item that should contain a tooltip. This can be made more easy by creating an item type plug-in with a built-in tooltip. And if you create an item of type plug-in, you will be asked to enter some text for the tooltip.

Getting ready

For this recipe, you can use an existing page with a region where you can put some text items on.

How to do it...

  1. Go to Shared Components | User Interface | Plug-ins.

    Oracle APEX Plug-ins

  2. Click on the Create button.
  3. In the name section, enter a name in the name text field. In this case, we enter tooltip.
  4. In the internal name text field, enter an internal name. It is advised to use your company's domain address reversed to ensure the name is unique when you decide to share this plug-in. So, for example, you can use com.packtpub.apex.tooltip.
  5. In the source section, enter the following code to the PL/SQL code textarea:

    function render_simple_tooltip (
    p_item in apex_plugin.t_page_item
    , p_plugin in apex_plugin.t_plugin
    , p_value in varchar2
    , p_is_readonly in boolean
    , p_is_printer_friendly in boolean )
    return apex_plugin.t_page_item_render_result
    is
    l_result apex_plugin.t_page_item_render_result;
    begin
    if apex_application.g_debug
    then
    apex_plugin_util.debug_page_item (
    p_plugin => p_plugin
    , p_page_item => p_item
    , p_value => p_value
    , p_is_readonly => p_is_readonly
    , p_is_printer_friendly => p_is_printer_friendly);
    end if;
    --
    sys.htp.p('<input type="text" id="'||p_item.name||'" name="'||p_item.name||'" class="text_field" onmouseover="toolTip_enable(event,this,'||''''||p_item.attribute_01||''''||')">');
    --
    return l_result;
    end render_simple_tooltip;

    This function uses the sys.htp.p function to put a text item on the screen. On the text item, the onmouseover event calls the function tooltip_enable(). This function is an APEX function and can be used to put a tooltip on an item. The arguments of the function are mandatory.
    The function starts with the option to show debug information. This can be very useful when you have created a plug-in and it doesn't work. After the debug information the htp.p function puts the text item on the screen, including the call to tooltip_enable. You can also see that the call to tooltip_enable uses p_item.attribute_01. This is a parameter that you can use to pass a value to the plug-in. That is the following step in this recipe.

  6. The function ends with the return of l_result. This variable is of type apex_plugin.t_page_item_render_result. For the other types of plug-in there are also dedicated return types, for example, t_region_render_result.
  7. Click on the Create button.
  8. The next step is to define the parameter (attribute) for this plug-in. In the Custom Attributes section, click the Add Attribute button.

    Oracle APEX Plug-ins

  9. In the name section, enter a name in the label text field, for example tooltip.
  10. Ensure that the attribute text field contains the value 1.
  11. In the settings section, set the type to text.
  12. Click on the Create button.
  13. In the callbacks section, enter render_simple_tooltip into the render function name text field.
  14. Click on the Apply changes button.
  15. The plug-in is ready now. The next step is to create an item of type tooltip plug-in.
  16. Go to a page with a region where you want to use an item with a tooltip.
  17. In the items section, click on the add icon to create a new item.

    Oracle APEX Plug-ins

  18. Select Plug-ins.

    Oracle APEX Plug-ins

  19. Now you will get a list of available plug-ins. Select the one we just created, tooltip. Click on Next.
  20. In the item name text field, enter a name for the item, for example tt_item.
  21. In the region select list, select the region you want to put the item in. Click Next.
  22. In the next step, you will get a new option. It's the attribute you created with the plug-in. Enter the tooltip text here. Click Next.
  23. In the last step, leave everything as it is and click the Create item button.
  24. You are ready now. Run the page. When you move your mouse pointer over the new item, you will see the tooltip.

    Oracle APEX Plug-ins

Oracle APEX 4.0 Cookbook Over 80 great recipes to develop and deploy fast, secure, and modern web applications with Oracle Application Express 4.0 with this book and eBook
Published: December 2010
eBook Price: £22.99
Book Price: £36.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Oracle, see here.)

How it works...

As stated before, this plug-in actually uses the function htp.p to put an item on the screen. Together with the call to the JavaScript function toolTip_enable on the onmouseover event, this makes this a text item with a tooltip, replacing the normal text item.

There's more...

The tooltips shown in this recipe are rather simple. You could make it look better, for example, by using the Beautytips tooltips. Beautytips is an extension to jQuery and can show configurable help balloons. Visit http://plugins.jquery.com to download Beautytips. We downloaded version 0.9.5-rc1 to use in this recipe.

  1. Go to Shared Components and click the plug-ins link.
  2. Click on the tooltip plug-in you just created.
  3. In the source section, replace the code with the following code:

    function render_tooltip (
    p_item in apex_plugin.t_page_item,
    p_plugin in apex_plugin.t_plugin,
    p_value in varchar2,
    p_is_readonly in boolean,
    p_is_printer_friendly in boolean )
    return apex_plugin.t_page_item_render_result
    is
    l_result apex_plugin.t_page_item_render_result;
    begin
    if apex_application.g_debug
    then
    apex_plugin_util.debug_page_item (
    p_plugin => p_plugin
    , p_page_item => p_item
    , p_value => p_value
    , p_is_readonly => p_is_readonly
    , p_is_printer_friendly => p_is_printer_friendly);
    end if;

    The functions also starts with the debug option to see what happens when something goes wrong.

    --Register the javascript and CSS library the plug-in uses.</p>

    apex_javascript.add_library (
    p_name => 'jquery.bgiframe.min',
    p_directory => p_plugin.file_prefix,
    p_version => null );
    apex_javascript.add_library (
    p_name => 'jquery.bt.min',
    p_directory => p_plugin.file_prefix,
    p_version => null );
    apex_javascript.add_library (
    p_name => 'jquery.easing.1.3',
    p_directory => p_plugin.file_prefix,
    p_version => null );
    apex_javascript.add_library (
    p_name => 'jquery.hoverintent.minified',
    p_directory => p_plugin.file_prefix,
    p_version => null );
    apex_javascript.add_library (
    p_name => 'excanvas',
    p_directory => p_plugin.file_prefix,
    p_version => null );

After that you see a number of calls to the function apex_javascript.add_library. These libraries are necessary to enable these nice tooltips. Using apex_javascript.add_library ensures that a JavaScript library is included in the final HTML of a page only once, regardless of how many plug-in items appear on that page.

sys.htp.p('<input type="text" id="'||p_item.name||'" class="text_field" title="'||p_item.attribute_01||'">');
--
apex_javascript.add_onload_code (p_code => '$("#'||p_item.name||'").bt({
padding: 20
, width: 100
, spikeLength: 40
, spikeGirth: 40
, cornerRadius: 50
, fill: '||''''||'rgba(200, 50, 50, .8)'||''''||'
, strokeWidth: 4
, strokeStyle: '||''''||'#E30'||''''||'
, cssStyles: {color: '||''''||'#FFF'||''''||', fontWeight: '||''''||'bold'||''''||'} });');
--
return l_result;
end render_tooltip;

Another difference with the first code is the call to the Beautytips library. In this call you can customize the text balloon with colors and other options. The onmouseover event is not necessary anymore as the call to $().bt in the wwv_flow_javascript.add_onload_code takes over this task. $().bt is a jQuery JavaScript function which references the generated HTML of the plug-in item by ID, and converts it dynamically to show a tooltip using the beautytips plug-in.

You can of course always create extra plug-in item type parameters to support different colors per item.

To add the other libraries, do the following:

  1. In the files section, click on the Upload new file button.
  2. Enter the path and the name of the library. You can use the file button to locate the libraries on your filesystem. Once you have selected the file, click on the upload button.
    The files and their locations can be found as follows:

    Library

    Location

    jquery.bgiframe.min.js

    \bt-0.9.5-rc1\other_libs\bgiframe_2.1.1

    jquery.bt.min.js

    \bt-0.9.5-rc1

    jquery.easing.1.3.js

    \bt-0.9.5-rc1\other_libs

    jquery.hoverintent.minified.js

    \bt-0.9.5-rc1\other_libs

    Excanvas.js

    \bt-0.9.5-rc1\other_libs\excanvas_r3

    Oracle APEX Plug-ins

  3. If all libraries have been uploaded, the plug-in is ready. The tooltip now looks quite different:

    Oracle APEX Plug-ins

See also

For more information on this tooltip, go to: http://plugins.jquery.com/project/bt.

Creating a region type plug-in

As you may know, a region is actually a div. With the region type plug-in you can customize this div. And because it is a plug-in, you can reuse it in other pages. You also have the possibility to make the div look better by using JavaScript libraries. In this recipe, we will make a carousel with switching panels. The panels can contain images but they can also contain data from a table. We will make use of another jQuery extension, Stepcarousel.

Getting ready

You can download stepcarousel.js from http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm. However, in order to get this recipe work in APEX, we needed to make a slight modification in it. So, stepcarousel.js, arrowl.gif, and arrow.gif can be downloaded from here: Support.

How to do it...

  1. First, we will create the plug-in. Go to shared components and click on the plug-ins link.
  2. Click on the Create button.
  3. In the Name section, enter a name for the plug-in in the Name field. We will use Carousel.
  4. In the Internal name text field, enter a unique internal name. It is advised to use your domain reversed, for example, com.packtpub.carousel.
  5. In the type list box, select Region.
  6. In the Source section, enter the following code in the PL/SQL code text area:

    function render_stepcarousel (
    p_region in apex_plugin.t_region,
    p_plugin in apex_plugin.t_plugin,
    p_is_printer_friendly in boolean )
    return apex_plugin.t_region_render_result
    is
    cursor c_crl is
    select id
    , panel_title
    , panel_text
    , panel_text_date
    from app_carousel
    order by id;
    --
    l_code varchar2(32767);
    begin

The function starts with a number of arguments. These arguments are mandatory but have a default value. In the declare section, there is a cursor with a query on the table APP_CAROUSEL. This table contains several data to appear in the panels in the carousel.

--
add the libraries and stylesheets
--
apex_javascript.add_library (
p_name => 'stepcarousel',
p_directory => p_plugin.file_prefix,
p_version => null );
--
--Output the placeholder for the region which is used by the Javascript code

The actual code starts with the declaration of stepcarousel.js. There is a function, APEX_JAVASCRIPT.ADD_LIBRARY to load this library. This declaration is necessary but this file needs also to be uploaded in the next step. You don't have to use the extension .js here in the code.

--
sys.htp.p('<style type="text/css">');
--
sys.htp.p('.stepcarousel{');
sys.htp.p('position: relative;');
sys.htp.p('border: 10px solid black;');
sys.htp.p('overflow: scroll;');
sys.htp.p('width: '||p_region.attribute_01||'px;');
sys.htp.p('height: '||p_region.attribute_02||'px;');
sys.htp.p('}');
--
sys.htp.p('.stepcarousel .belt{');
sys.htp.p('position: absolute;');

sys.htp.p('left: 0;');
sys.htp.p('top: 0;');
sys.htp.p('}');
sys.htp.p('.stepcarousel .panel{');
sys.htp.p('float: left;');
sys.htp.p('overflow: hidden;');
sys.htp.p('margin: 10px;');
sys.htp.p('width: 250px;');
sys.htp.p('}');
--
sys.htp.p('</style>');

After the loading of the JavaScript library, some style elements are put on the screen. The style elements could have been put in a Cascaded Stylesheet (CSS) but since we want to be able to adjust the size of the carousel we use two parameters to set the height and width. And the height and the width are part of the style elements.

--
sys.htp.p('<div id="mygallery" class="stepcarousel" style="overflow:hidden"><div class="belt">');
--
for r_crl in c_crl
loop
sys.htp.p('<div class="panel">');
sys.htp.p('<b>'||to_char(r_crl.panel_text_date,'DD-MON-YYYY')||'</b>');
sys.htp.p('<br>');
sys.htp.p('<b>'||r_crl.panel_title||'</b>');
sys.htp.p('<hr>');
sys.htp.p(r_crl.panel_text);
sys.htp.p('</div>');
end loop;
--
sys.htp.p('</div></div>');

The next command in the script is the actual creation of a div. Important here is the name of the div and the class. The stepcarousel searches for these identifiers and replaces the div with the stepcarousel. The next step in the function is the fetch of the rows from the query in the cursor. For every line found, the formatted text is placed between the div tags. This is done so that stepcarousel recognizes that the text should be placed on the panels.

--Add the onload code to show the carousel
--
l_code := 'stepcarousel.setup({
galleryid: "mygallery"
,beltclass: "belt"
,panelclass: "panel"
,autostep: {enable:true, moveby:1, pause:3000}
,panelbehavior: {speed:500, wraparound:true, persist:true}
,defaultbuttons: {enable: true, moveby: 1, leftnav: ["'||p_plugin.file_prefix||'arrowl.gif", -5, 80], rightnav: ["'||p_plugin.file_prefix||'arrowr.gif", -20, 80]}
,statusvars: ["statusA", "statusB", "statusC"]
,contenttype: ["inline"]})';
--
apex_javascript.add_onload_code (p_code => l_code);
--
return null;
end render_stepcarousel;

The function ends with the call to apex_javascript.add_onload_code. Here starts the actual code for the stepcarousel and you can customize the carousel, like the size, rotation speed, and so on.

  1. Click on the Create button.
  2. In the callbacks section, enter the name of the function in the return function name text field. In this case, it is render_stepcarousel.
  3. In the files section, upload the files stepcarousel.js, arrowl.gif and arrowr.gif.

For this purpose, the file stepcarousel.js has a little modification in it. In the last section (setup:function), document.write is used to add some style to the div. Unfortunately, this will not work in APEX, as document.write somehow destroys the rest of the output. So, after the call, APEX has nothing left to show, resulting in an empty page. Document.write needed to be removed and the style elements need to be added in the code of the plug-in:

sys.htp.p('<div id="mygallery" class="stepcarousel" style="overflow:hidden"><div class="belt">');

 

In this line of code you see style='overflow:hidden'. That is the line that actually had to be included in stepcarousel.js. This command hides the scrollbars.

  1. After you have uploaded the files, click the Apply changes button. The plug-in is ready and now we can use it in a page.
  2. Go to the page where you want this stepcarousel to be shown.
  3. In the regions section, click the Add icon.
  4. In the next step, select Plug-ins.
  5. Select Carousel.
  6. Click on Next.
  7. Enter a title for this region, for example Newscarousel. Click Next.
  8. In the next step, enter the height and the width of the carousel. To show a carousel with three panels, enter 800 in the width text field. Enter 100 in the height text field. Click Next.
  9. Click the Create region button.
  10. The plugin is ready. Run the page to see the result.

How it works...

The stepcarousel is actually a div. The region type plug-in uses the function sys.htp.p to put this div on the screen. In this example, a div is used but for the region, but also a HTML table can be used. An APEX region can contain any HTML output but for the positioning, mostly a HTML table or a div is used, especially when layout is important within the region.

The apex_javascript.add_onload_code starts the animation of the carousel. The carousel switches panels every three seconds. This can be adjusted (pause:3000).

See also

For more information on this jQuery extension, go to http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm.

Creating a dynamic action plug-in

A dynamic action is a piece of code that can handle page events (onchange, onclick, and so on). It is actually the APEX implementation of JavaScript event handling. For example, you can show or hide an item or a region on a specific moment. And that moment can be, for example, when a user clicks an item with the mouse, or when a user enters some text in an item. These moments are called events.

A dynamic action plug-in offers the same functionality but you can customize the appearance of the affected objects. In this recipe, we will show you how you can make a dynamic action plug-in which changes the color of a text item when a user enters some text in another text item.

Getting ready

No preparations are needed, except that you have an existing page with a region where you can put the items from this recipe on.

How to do it...

  1. In the application builder, go to Shared Components | Plug-ins.
  2. Click on the Create button.
  3. In the name section, enter a name for the plug-in, for example setcolor.
  4. In the Internal name text field, enter a unique name, for example, com.packtpub.setcolor. In the type list box, select Dynamic action.
  5. In the category list box, select Miscellaneous (use this category to easily find the plug-in back in the categorized action listbox later on in the recipe).
  6. In the source section, enter the following code into the PL/SQL code text field:

    function render_setcolor (
    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
    l_result.javascript_function := 'function(pAction){this.affectedElements.css("color", this.action.attribute01);}';
    l_result.attribute_01 := p_dynamic_action.attribute_01;

    return l_result;
    end render_setcolor;

    This piece of code starts with the declaration of the function with its parameters. The return value should be of type apex_plugin.t_dynamic_action_render_result. This return type contains the call to the built-in JavaScript function this.affectedElements.css(), which can change the style attributes of an object in the webpage, in this case a text item. The value of the color is set by the parameter p_dynamic_action.attribute_01.

  7. In the Callbacks section, enter render_setcolor into the render function name text field.
  8. In the Standard attributes section, check the For Item(s) and the Affected Element Required checkbox.

    Oracle APEX Plug-ins

  9. Click on the Create button.
  10. In the Custom Attributes section, click the Add Attribute button.

    Oracle APEX Plug-ins

  11. In the name section, enter color into the label text field.
  12. Click on the Create button.
  13. Click on the Apply changes button.

The plug-in is ready and now we will create two text items, one for triggering the event and one that is going to be the affected item.

  1. Go to an existing page where you want to put this.
  2. In the items section, click the Add icon.
  3. Select Text field.
  4. Enter a name for the text field, for example PX_EVENT (replace X by the page ID).
  5. Click on Next three times.
  6. Click on the Create item button to finish the create item wizard.
  7. Again in the items section, click the add icon.
  8. Select Text field.
  9. Enter a name for the text field, for example PX_TEXT (replace X by the page ID).
  10. Click on Next two times.
  11. Click on Create item.

The two items are ready now. The last thing we have to do is to create the dynamic action.

  1. In the dynamic actions section in the lower left corner, click the Add icon.
  2. Select Advanced.
  3. Enter a name for the dynamic action, for example set_color. Click Next.
  4. In the Items text field, enter the name of the event item, PX_EVENT (replace X by the page id).
  5. In the condition list box, select Equal to.
  6. In the value text area, enter SEMINAR. Click Next.
  7. In the action list box, select our newly created plug-in, setcolor[Plug-in].

    Oracle APEX Plug-ins

  8. In the color text field, enter a color, for example, blue. Click Next.
  9. In the false action select box, again select the new plug-in, setcolor(Plug-in).
  10. In the color text field, enter another color, green. Click Next.
  11. In the selection type list box, select Item.
  12. Click on the item PX_TEXT (replace X by the page ID) and click on the single arrow in the middle of the shuttle. Click the Create button.
  13. You are ready now. Run the page and see what happens when you enter SEMINAR in the event text field.

    Oracle APEX Plug-ins

How it works...

This dynamic action plug-in works just as the normal dynamic actions except that there is a new action. Instead of show or hide, we now give the affected object a certain color, simply by changing the style of the object. We could have used some other style, for example font-weight instead of color. In that case, don't use the color names (blue and green) but bold and normal.

Oracle APEX 4.0 Cookbook Over 80 great recipes to develop and deploy fast, secure, and modern web applications with Oracle Application Express 4.0 with this book and eBook
Published: December 2010
eBook Price: £22.99
Book Price: £36.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Oracle, see here.)

Creating a process type plug-in

A process type plug-in extends the functionality of a page process. This can be anything but it is typically used for APEX built-ins or Internet functionalities like e-mail sender or Twitter update. The benefit of this is that the process type plug-ins can be reused. We will create a process type plug-in which changes the language by using the APEX_UTIL.SET_SESSION_LANG built-in. There are more ways to change the session language but in this recipe, we will use this built-in in a page process to demonstrate how it works.

Getting ready

Make sure you have an existing webpage with a region.

How to do it...

  1. Go to shared components and click Plug-ins.
  2. Click on the Create button.
  3. In the name section, enter set_language in the name text field.
  4. In the internal name text field, enter a unique name, for example com.packtpub.set_language.
  5. In the type list box, select Process.
  6. In the PL/SQL code text area, enter the following code:

    function set_language (
    p_process in apex_plugin.t_process,
    p_plugin in apex_plugin.t_plugin )
    return apex_plugin.t_process_exec_result
    is
    Dynamic Attribute mapping
    l_language varchar2(50) := p_process.attribute_01;
    l_result apex_plugin.t_process_exec_result;
    begin
    Set session language
    apex_util.set_session_lang(l_language);
    Set success message
    l_result.success_message := 'Session language switched to '||l_language;
    return l_result;
    end set_language;

The function starts with two arguments, which are necessary but have a default value. The return type is apex_plugin.t_process_exec_result. The actual switch is done by APEX_UTIL.SET_SESSION_LANG.

  1. In the callbacks section, enter set_language in the execution function name.
  2. Click on the Create button.
  3. In the custom attributes section, click the Add Attribute button.
  4. In the name section, enter Language in the label text field.
  5. Click on the Create button. The process type plug-in is ready. Now we will create a text item and a button to start the process.
  6. Go to your application and click on the page you want to edit.
  7. In the processes section, click the add icon.
  8. Select plug-ins.
  9. Select the plug-in we just created, set_language.
  10. Enter a name for this plug-in, for example, setlang. Click Next.
  11. In the language text field, enter &PX_LANGUAGE. (replace X by the page ID).
  12. Click on the Create process button.
  13. In the items section, click the add icon.
  14. Select the Select list.
  15. Enter PX_LANGUAGE (replace X by the page id) in the item name text field.
  16. In the region select list, select the region you want to put this item on. Click on Next two times.
  17. In the create item section, set the page action when value changed list box to Submit page. Click on Next.

    Oracle APEX Plug-ins

  18. Click on the Create or edit static List of Values link.

    Oracle APEX Plug-ins

  19. In the pop-up window, enter the following languages in both columns:

    Oracle APEX Plug-ins

  20. Click on the Apply button.
  21. Click on Next.
  22. Click on the Create item button.

The process type plug-in and the page are ready now. Run the page and test the plug-in.

How it works...

The only thing this plug-in does is a call to apex_util.set_session_lang with a language abbreviation.

There's more...

See http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i634428 for a list of country and language codes.

Summary

This article described the four types of plug-ins: Item type, Region type, Dynamic action, and Process type plug-ins.


Further resources on this subject:


About the Author :


Marcel Van Der Plas

Marcel van der Plas was born in 1969 in Eindhoven and still lives there. He has been an Oracle Consultant for over 15 years. Marcel has worked on many projects with Oracle Designer, Oracle Forms, and Oracle Reports. Later on, he became interested in APEX and did some projects with APEX. Marcel has been working on an APEX project for an electronics company for over 2 years.

Marcel currently works for Ciber. Other companies he worked for are Atos Origin and Whitehorses. For Whitehorses, he wrote some articles (White books) about Oracle.

Marcel wrote the Oracle APEX 4.0 Cookbook, Packt Publishing, with Michel van Zoest. You can find APEX blogposts from Marcel at http://orclapex.blogspot.com. Besides that, you can follow Marcel on Twitter (@whmvdp).

Michel Van Zoest

Michel van Zoest is a consultant with years of experience in building web applications using Oracle technologies such as Oracle Web Forms, Oracle Designer, MOD_PLSQL, ADF, SOA Suite, and of course, APEX.

He is one of the first Oracle Application Express Developer Certified Experts in the world. He has used his APEX knowledge in projects for companies ranging in size from a single employee to large multinationals. His experience in these projects has been used in the realization of this book.

Michel currently works at Whitehorses in the Netherlands and runs his own blog at http://www.aboutapex.com. He also blogs at the company website on http://blog.whitehorses.nl and he regularly writes White book articles (in Dutch) for Whitehorses.

You can reach Michel on Twitter at @mvzoest or e-mail him at michel@aboutapex.com.

Books From Packt


Oracle JRockit: The Definitive Guide
Oracle JRockit: The Definitive Guide

Oracle Fusion Middleware Patterns
Oracle Fusion Middleware Patterns

Oracle SOA Suite   11g R1 Developer's Guide
Getting Started with Oracle BPM Suite 11gR1 – A Hands-On Tutorial

Oracle Siebel CRM 8 Installation and Management
Oracle Siebel CRM 8 Installation and Management

Oracle E-Business Suite R12 Supply Chain   Management
Oracle E-Business Suite R12 Supply Chain Management

Oracle Application Express 3.2 - The Essentials and   More
Oracle Application Express 3.2 - The Essentials and More

Web 2.0 Solutions with Oracle WebCenter 11g
Web 2.0 Solutions with Oracle WebCenter 11g

Oracle Application Express 4.0 with Ext JS: RAW
Oracle Application Express 4.0 with Ext JS: RAW


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software