I'm fairly new to APEX, but I'm getting to a point where it is getting complicated for me, so I need a bit help. I have a dialog form with a Tabular Form with a composite primary key (S_ID
and DEPARTMENT_ID
). I'm adding a Select List via APEX_ITEM.SELECT_LIST
method as the last column with two values (Approve:0;Reject:1
) and a Submit button. If the user "flags" at least one record as Reject
, once the page is submitted I want to update two hidden fields in the selected record from the Tabular Form. If the user selects all records as Approve
then I need to update a status and a date in another table. The default values of the select list are Approve
for all records.
I'm pretty good with SQL and PL/SQL, but once I added the APEX_ITEM.SELECT_LIST
, I realized that JavaScript might be needed and this is where I got stuck. I can probably figure it out just with PL/SQL if I add a field to the table and then tie the SELECT List to it, but then I have unnecessary table field which I'm trying to avoid. I wanted to resolve it with a "virtual" column.
Any ideas?
Thank you in advance.
When you are using the
apex_item.select_list
function (or any another function ofapex_item
package) APEX allows you to useapex_application.g_fXX
collections, whereXX
- number, which you pass as a first parameter. These collections contain data from the tabular form and could be accessed in PL/SQL after the page submit.Let's say we have a table:
You need to do following. Create a report with a query like this:
Using
apex_item
package initiates using of collectionsg_f01
,g_f02
andg_f03
. Next, create a button to submit and a process, which will be executed, when theSubmit
button is pressed. The process could contain a code like this:In this code, you can implement any logic you need to process user's input.
You can see this example on the page here: https://apex.oracle.com/pls/apex/f?p=34599:8
The
Submit
button executes the code above, theReset
button changes values to default.