Skip to main content

Posts

Showing posts from August, 2016

Fix Interactive Report headers issue when using a Region Display Selector

When you have multiple Interactive Reports (IR) on your page and use a Region Display Selector to mimic tabs, you might notice some weird behaviour in the IR headings if you switch tabs. The headings are not positioned correctly and you get an extra empty row under the headings. It just looks weird and ugly. But if you resize your browser window, it all looks fine again (until you switch to another tab..) So can we fix this by creating a Dynamic Action that mimics that "browser window resize" event? Yes we can! Create a Dynamic Action that fires on Click of the jQuery selector li.apex-rds-item a . That should fire a JavaScript snippet :  apex.event.trigger(this.triggeringElement, "apexwindowresized"); So now a click on a tab not only switches from one IR to another but also fires that event that will "autofix" the IR headers. A simple solution for an annoying problem. This applies to APEX 5.0, I assume it will be solved in 5.1.

Creating an APEX plugin for an Oracle JET component - Part 2

In my previous blogpost I showed how you can embed an Oracle JET component in your APEX application. Now it is time to make a plugin out of the wisdom we gained doing so. First of all a disclaimer. My intention is to make this plugin and the inner workings as simple as possible. So you can add a lot more functionality, checks etc and therefore add complexity. But this is intended to be as simple as possible. The plugin consists of three parts: a PL/SQL render function, a snippet of JavaScript and a PL/SQL ajax function. The render function is defined as : function render  ( 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   c_region_static_id      constant varchar2(255)  := apex_escape.html_attribute( p_region.static_id ); begin   -- Add placeholder div   sys.htp.p (      '<div class="a-JET-PictoCha

Creating an APEX plugin for an Oracle JET component - Part 1

In APEX 5.1 (still Early Adaptor 1 at this moment), Oracle JET - Javascript Extension Toolkit -  is included to facilitate charting. The APEX Development Team recently mentioned that not only the Data Visualisations part of JET will be included in APEX 5.1, but the complete installation of JET. The whole package. That won't do the size of the downloadable install file any good, but more important is: what can we do with it? A number of the Data Visualisations will be exposed in APEX for the declarative definition of charts as we are used to now using the Anycharts library. But there are more Data Visualisations - check the JET Cookbook for all examples - and other components that might be of interest for an APEX application. So how can we use these in our apps? As an example, I would like to use the PictoChart component in my application. Fist of all - as we don't have APEX 5.1 yet - we need to download the Oracle JET library and install the files on either yo

Consuming a REST Web Service returning JSON in APEX

In APEX you can define a web service that returns XML as below - all declarative, just a few steps through a wizard. Then generate a report on top of that web service - again just a few clicks through a wizard. The generated query looks like this: select xtab."customerName"      , xtab."customerId"   from apex_collections c,            XMLTable('/Response/S_getCustomerListTableArray/S_getCustomerListArrayItem' passing xmltype001             COLUMNS "customerName" PATH 'customerName'                   , "customerId"   PATH 'customerId'           ) xtab  where c.collection_name = 'CUSTOMERLIST' So the result of the web service is stored in an XMLTYPE column. And it's easy to spot where you're definitions for the Response XPath and Output Parameters are used. But what if your web service returns JSON - as more and more web services will do so? If you switch the Output Format