Reuse and Show Apex's Wait Popup

Oracle Apex supports or offers a GIF image and an overlay while loading content using Dynamic Action/AJAX. While creating a dynamic action you have an option to select "Show Processing" for supported actions.

This shows a nice overlay over the screen and a GIF image out of the box. You may have scenarios to show a loading while doing some javascript/jquery actions on your own.

Will it not be nice to show/reuse the same overlay and image?

This article explains how to do it.

Say you have a function to load data from server and show on page using a javascript function:

function previewFiles(){
  ajax.widget.waitPopup();
}

The above javascript call will show the overlay and GIF image. This is very simple isn't it. But to hide it, there is no function. We have to call following jquery method calls.

$("#apex_wait_popup").remove();  
$("#apex_wait_overlay").remove();

Which will remove the popup and overlay from DOM. To simplify things we will create this as a javascript function and save in one's library.

function hideWaitPopup(){
  $("#apex_wait_popup").remove();  
  $("#apex_wait_overlay").remove();
}

Then simply call hideWaitPopup(); inside your javascript function to hide the popup and overlay.

Inserting DBMS_OUTPUT from wrapped procedures into a table

This tip is courtesy +V. Kapoor from http://www.foxinfotech.in. Thank you, you saved my day.

I had a situation where the database procedure SRW is wrapped and I needed to log the dbms_output.put_line output produced by the package into a table. Thanks to the tip provided, I was able to do so.

I had to call the following procedure

dbms_output.get_lines(vcol, n);

This procedure is intended to retrieve an array of lines from buffer. This means if the buffer is not cleared it will be available in the array (out parameter 1). The second parameter is the number of lines in array returned by the procedure.

To declare the OUT variables required by this procedure do the following:

n number;
vcol dbms_output.chararr;

Simply put together the code will be as follows:

DECLARE
   n      NUMBER := 100;
   vcol   DBMS_OUTPUT.chararr;
BEGIN
   srw.start_debugging;
   srw.run_report(...);
   srw.stop_debugging;

   --- get the output into vcol array
   DBMS_OUTPUT.get_lines (vcol, n);

   FOR i IN 1 .. n LOOP
      INSERT INTO log_table (char_col, procname, log_date) VALUES (vcol (i), USER, SYSDATE);
   END LOOP;

   COMMIT;
END;

Opening Oracle Apex Links in iframe

Starting Oracle Apex 4.1, application pages by default will not open inside an iframe (inline frame).

There is a new security setting introduced, which is restricting this feature. As commented by +Patrick Wolf  in community.oracle.com the following setting has to be changed to enable this feature:

This is what he had to say: "There is a new security feature to prevent clickJacking attacks. For new applications it's enabled, for existing ones it's disabled. Please see Shared Components > Security Attributes > Browser Security -> Embed in Frames"



Keeping this for my reference purposes only.