I have a form which has two select lists. The first one is prepopulated with an SQL query and has a dynamic action to set the value of the second list based on what is selected in the first.
I tested this out with a select list-textbox combination and it works just fine. However when I try to change the textbox into a select list then I am forced to also provide a "list of values" which overwrites my dynamic action.
How can I create a select list without specifying its List of Values?
Some clarification about my situation.
I have 2 tables: Wines and Winegroups.
+---------+------------+
| Wines | Winegroups |
+---------+------------+
| WineID | GroupID |
| Name | Name |
| GroupID | |
+---------+------------+
In APEX I have a form like this:

When the page is loaded, the first select list will get filled with values using this query:
select distinct Name, GroupID from Winegroups
Furthermore there is a dynamic action defined like this which fires whenever a group is selected. This is supposed to change the values inside the 'Wines' select list.
Event: Change
Selection type: Items on P5_GROUPID
Action: Set value
Page items to submit: P5_GROUPID
Affected elements: Items on P5_NAME
select distinct Wines.Name, Wines.WineID id
from Wines
left join Winegroups
on Wines.GroupID = Winegroups.GroupID
where Winegroups.Name = :P5_GROUPID
order by 1
The second select list uses the same query. When I execute my program the first select list is filled with groups nicely but the second one never gets any values.