Thursday 19 November 2015

Add Select Check-box in classic report

Classic report and would like to add a column with a checkbox so the user can select multiple rows and perform an action on all selected rows.

to add a checkbox to your classic report use apex_item.checkbox API function like this:
  1. select  
  2.     APEX_ITEM.CHECKBOX(p_idx=>1, p_value=>DEPTNO)  as select_dept,  
  3.     DEPTNO as DEPTNO,  
  4.     DNAME as DNAME,  
  5.     LOC as LOC  
  6. from DEPT  

Then you can access checked values (for example in a page process)
  1. declare  
  2. v_deleted_depts number := 0;  
  3. begin  
  4. FOR i in 1..APEX_APPLICATION.G_F01.count  
  5. LOOP  
  6.   v_deleted_depts := v_deleted_depts + 1;  
  7.   delete from dept where deptno = APEX_APPLICATION.G_F01(i);  
  8. END LOOP;  
  9. :P1_DEPTCOUNT := v_deleted_depts;  
  10. end;  

1 comment:

Show values in right side of shuttle

While working with select list and shuttle, when we want to display values into right side of shuttle depending upon selection from select ...