IR Checkbox Plugin

IR Checkbox Plugin

Introduction

An important feature is still missing in APEX – IR Checkbox. It often happens that we need to search for data in an IR to narrow it down, and then do something with this data or a part of it. Currently, APEX does not offer a standard feature for these purposes. At Kubicek Consulting GmbH (@Kubicek_CG), we developed a plugin years ago that enables this. We designed the plugin to provide immediate access to the selected IDs after selecting the rows. We used the APEX Collection to store the selected entries. This plugin has been running since version 18.2 and has never needed to be adjusted or changed. It also runs under 24.1. The idea behind it is very simple, as is the use and implementation of the plugin. Here we show how the implementation can be done.

Install the Plugin

You can download our plugin here  and import it into your workspace or the relevant application. No special setup of the plugin is necessary.

Solution Overview

Interactive Report

Create or select an existing Interactive Report and navigate to the page. Choose the ID column and assign a Static ID to it + disable all the options for the user (Hide, Sort, etc.):

Create a Dynamic Action and name it. Select the IR Checkbox [Plug-In] for the Action.

Name your Collection or leave the default value.

Type in the Static ID of the column you want to use.

Dynamic Action

Create a Dynamic Action container and name it.

Use Click-Event for the Selection Type Region > Your Region

IR Display

Your report should now be displayed like this:

You can create a button, which will be displayed if there is a row selection and hidden, if not. Create a new Action within your Dynamic Action using the following code:

				
					apex.server.process ( "checkSelected", {}, 
   { dataType: 'text', success: function( pData ) 
     { 
       if (pData == '0')
       {$('#SHOW_SELECTION').hide();}
       else {$('#SHOW_SELECTION').show();}
     }  
   } 
)

				
			

Create an Ajax Call on your page and name it “checkSelected”. Use the following code for it:

				
					DECLARE
    v_count NUMBER := 0;
BEGIN
    SELECT
        COUNT(*)
    INTO v_count
    FROM
        apex_collections
    WHERE
        collection_name = 'SELECTED_COLLECTION';

    htp.prn(v_count);
    
EXCEPTION
    WHEN OTHERS THEN
        htp.prn(v_count); 
END;

				
			

Now, if you select any of the rows, your button should appear:

It is quite easy to select, show or process the selected ID’s by using this SQL

				
					SELECT to_number (c001) FROM apex_collections WHERE collection_name = 'SELECTED_COLLECTION'

				
			

Conclusion

We have already seen and had to debug many different, more or less effective solutions for this problem. This was also one of the reasons why we decided to create our own plugin. Most of the solutions ran well for a while and then suddenly stopped working after the next update. There were also situations where the solutions only worked for a limited amount of data and encountered performance issues with large amounts of data. Our solution has been running in many applications for many years, and no significant problems are known to us.You can view the example in our Blog-Application here:

Comments are closed.