Creating Dependent Select Lists

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.

To have one LOV drive another LOV:

  • Create a basic form.

  • Define two lists of values. Note that the driving LOV must submit the page after a value is chosen.

  • Define 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 county name and county ID based on the state selected in the first LOV:

SELECT county_name d, county_id v
  FROM counties
WHERE state_id = :P1_STATE_ID