-
Book Overview & Buying
-
Table Of Contents
Oracle APEX Cookbook : Second Edition - Second Edition
In APEX, it is possible to use many different item types. Some of these we've already seen in other recipes. In this recipe we're going to talk about some of the advanced item types such as shuttles and HTML editors and how to interact with them.
To start with this recipe, create an empty page with ID 15 and put an HTML region with the name IT Employees on it.
The first example of an advanced item type is the shuttle list. We will use this list to add employees to the IT department. The shuttle will show a list of available employees on the left-hand side and a list of employees already in the IT department on the right-hand side.
P15_IT_SHUTTLE and click on Next until you reach the List of Values page in the wizard.select username display_value
, id return_value
from app_employees
where dept_id <> 3
[9672_01_07.txt]declare
v_list apex_application_global.vc_arr2;
begin
select username return_value
bulk collect
into v_list
from app_employees
where dept_id = 3;
return(apex_util.table_to_string(v_list));
end;
[9672_01_08.txt]Now the item will be populated with the employees:

The right-hand side of the shuttle item can also be populated by the default value that can be defined on the item's properties.
Another type of item we want to discuss here is the Cascading Select Item. Let's say we want to make a list of all employees. This is potentially a very long list, so before showing the employees, we first want to select the department we are working with.
First, we create the item that shows all departments for our company:
P15_DEPARTMENTS.select name display_value
, id return_value
from app_departments
[9672_01_09.txt]The next part is to create the select list for the employees in the department. Again, we create a select list like before and name it P15_EMPLOYEES.
Now when we reach the LOV wizard screen, we enter the following SQL:
select firstname||' '||lastname display_value
, id return_value
from app_employees
where dept_id = :P15_DEPARTMENTS
[9672_01_10.txt]Also on this screen, change the value of Cascading LOV Parent Item(s) to P15_DEPARTMENTS. Click on Next and then on Create Item.
When we now run the page and select a Department, we can see that the Employees list changes immediately.

Change the font size
Change margin width
Change background colour