mercredi 22 septembre 2021

Oracle Apex delete entry from collection

I have two interactive reports with check boxes. If the user select entries from interactive report1 and press a button, the selected entries will be added into a collection and displayed in interactive report2.

In interactive report2 I have again a checkbox and if the user select an entry, it should be deleted from the collection and interactive report2 by pressing a button.

I have defined a process which is fired when the button is pressed:

declare v_id number;
begin
FOR i in 1..APEX_APPLICATION.G_F03.count

LOOP
select id into v_id from apex_collections where collection_name = 'SELECTED2' and c001 = APEX_APPLICATION.G_F03(i);
   apex_collection.delete_member(
   p_collection_name => 'SELECTED2',
   p_seq => v_id);
END LOOP;
end;

SELECTED2 is the name of the collection.

APEX_APPLICATION.G_F03 is the checkox value of the check box in interactive report2.

Problem, the entire collection is deleted and not only the selected rows in interactive report2. How could I delete only the selected rows?




Aucun commentaire:

Enregistrer un commentaire