How to add select or select all checkboxes in Interactive Report?
Posted: Thu May 15, 2025 3:21 am
It is very normal to use Interactive Report and process selective records by giving checkboxes to users. Users can select single, multiple or can use select all and then process selected lines. By default till Oracle APEX 24.2.5 this functionality is not avaiable so here are the steps to enable such functionality.
Adding a column in table Optional
If you have already column to update or not required to update in the current table then you can skip this step.
Report SQL
Heading of column SELECTED
Set Process
Reset Button Code
Function and Global Variable Declaration
Adding a column in table Optional
If you have already column to update or not required to update in the current table then you can skip this step.
Code: Select all
alter table "WKSP_ERPSTUFF"."EMP" add ("SELECTION" VARCHAR2(1));
Code: Select all
select EMPNO,
apex_item.checkbox(1,EMPNO) as SELECTED,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO,
STATUS,
selection
from EMP
Code: Select all
<input type="checkbox" id="checkAll" >
Code: Select all
DECLARE
v_empno NUMBER;
BEGIN
-- Process only selected checkboxes
FOR i IN 1..apex_application.g_f01.COUNT LOOP
v_empno := apex_application.g_f01(i);
update emp set selection = 'Y' where empno = v_empno;
END LOOP;
END;
Code: Select all
update emp set selection = null;
Code: Select all
$(document).on('click', '#checkAll', function () {
$('input:checkbox').prop('checked', this.checked);
});