Within APEX, there are a multitude of things you can use Check Boxes for, and many ways they
can be used to improve your application. This tutorial will focus on some of the things you can
use them for, as well as how to set thier properties to make them work for you, not against you.
We reccomend you review our article APEX Tutorial Preparation and OEHR Sample Data Install if
you haven’t already, as this tutorial requires the OEHR Sample Data to work properly.
Part 1 – Multi Value Check Boxes and Adding Check Boxes
High Level Steps
1) Create Multi Vaule Check Boxes. (0:30)
2) Add Check Boxes to Each Row. (4:50)
Times in parenthesis are the approximate start times for those steps
Notes and Resources
Multi Value Boxes
What we are doing ius creating a set of multi valued check boxes to serve as a way to filter
the returned data by category. Check boxes give us the flexibility to pick just what we want,
and not be limites to a single choice or preset combination.
We create an odd computation and the purpose isn’t very clear. What we are doing is closing a
logic loophole in the behaviour of the check boxes. If you were to deselect all the check boxes,
all the products woudl be listed, instead of none, due to how the logic works (deseleted means
NULL< which means revert to default, which is Y, thus it’s on, even if off). By putting in this
computation, it essentially forces the system to remember the state of the check boxes.
The APEX_ITEM is part of the system supplied packages that allow you to dynamically add certain
items as the page is processed. In this case, we are using it to create a ‘delete’ checkbox for
each displayed row.
Code and Entered Text
Label, Source Value and LOV for P1_REPORT_SEARCH
SELECT DISTINCT product_status display_value, product_status return_value FROM oehr_product_information ORDER BY 1
Below is the new WHERE clause for the Product Report Source SQL Query
WHERE instr(':'||:P1_REPORT_SEARCH||':',product_status)> 0
Computation and Expression 1 for P1_REPORT_SEARCH
Form Element for P1_REPORT_SEARCH
New line to be added to the Region Source SQL Query for the Product Report Region
Below is the PL/SQL code for the Delete Products Process
FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP DELETE FROM oehr_product_information WHERE product_id = APEX_APPLICATION.G_F01(i); END LOOP;
Sucess and Fail messages for the Delete Products Process
Unable to delete product(s).