I got some questions about setting the default value of a shuttle. The example can be seen here.
Basically a Shuttle are two lists: on the left you'll see all values, which you can select by moving it to the right. If you already want some values on the right when you open the page, how do you do that?
The APEX components in my example: a Region, a Shuttle item and a Computation.
Creating the region and the Shuttle isn't that hard. The query of the Shuttle is:
SELECT ename, empno FROM emp ORDER by 1The computation is of type "PL/SQL Function Body". The actual code looks like this:
What does it do?It fills an array "emp_list" with all the values you want to have already selected (on the left in the shuttle). In my case the first 3 records.
The most important part is the last line APEX_UTL.TABLE_TO_STRING. Which transforms the array in a way so the shuttle can understand it. A string, with in between the values a ':'.
That's just one way of doing it. In APEX you can follow different ways to accomplish the same result. Hope it helps some of you.



