Application Express User's Guide > Building an Application > Creating Dependent Select L...
Creating Dependent Select Lists |
Previous |
Next |
You can use a select list to determine the range of values of another select list on the same page. You can achieve this functionality by having a driving select list submit values to a subsequent select list. You incorporate these values in the subsequent select list as a bind variable in the WHERE clause of its query.
You can have one LOV drive another LOV by:
Creating a basic form.
Defining two lists of values. Note that the driving LOV must submit the page after a value is chosen.
Defining a branch that branches back to the current page.
Consider the following example. The first LOV enables the user to pick a state.
SELECT state_name d, state_id v FROM states
The second LOV selects the country name and country ID based on the state selected in the first LOV.
SELECT county_name d, county_id v FROM counties WHERE state_id = :Px_STATE_ID