Process only Selected Rows in IG Solution

Oracle Application Express is a rapid development tool for Web applications on the Oracle database.
Post Reply
admin
Posts: 2096
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Process only Selected Rows in IG Solution

Post by admin »

1. Create an IG
2. Create a Text Item to Keep selected Values like in my case P2_SELECTED
3. Create Dynamic Action on IG > Selection Change IG and write following Javascript

Code: Select all

var model = this.data.model;
var selectedRecords = this.data.selectedRecords;
var idList = [];

for (var i = 0; i < selectedRecords.length; i++) {
    var id = model.getValue(selectedRecords[i], "PROJECT_ID");
    if (id) {
        idList.push(id);
    }
}

var r_req_id = idList.join("|");
apex.item("P2_SELECTED").setValue(r_req_id);
4. Create a process to process selected Project ID.

Code: Select all

DECLARE
    l_ID apex_t_varchar2;
BEGIN

    l_ID := apex_string.split(p_str => :P2_SELECTED, p_sep => '|');

    FOR i IN 1 .. l_ID.COUNT LOOP
    insert into t (data) values (l_ID(i));        
    END LOOP;
END;
Now test and enjoy.
Malik Sikandar Hayat
Oracle ACE Pro
info@erpstuff.com
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest