Using Recordsets

Recordsets are server behaviors which use queries to retrieve data from a database; WA Dynamic DropDowns uses recordsets to provide the list options for the Parent List and Child list.

To learn more about using recordsets, please see Help > Using Dreamweaver.

The functionality of this extension is such that you must specify two recordsets, one for the information in your Parent Table and one for the information in your Child Table, for your dropdown to work appropriately. For this reason it is helpful to think of, create, and use naming conventions for recordsets that will correlate one recordset for your Parent list options and one recordset for your Child list options.

Parent recordset

Create a recordset that retrieves from your Parent Table: This recordset will be used by the Create Dynamic List server behavior to populate your Parent List with its values from the database. To learn more about this server behavior, see Creating a Dynamic List/Menu.

Child recordset

Create a recordset that retrieves from your Child Table: The Create Dynamic Array server behavior and the Populate List From Array behavior use this recordset. These two behaviors work cooperatively to populate your Child List with values from the database that correspond to selections made in your Parent List in the active web page. To learn more about these Behaviors, see Populating a Child List from a Parent List.

Important: For your recordsets to work with the Dynamic Dropdowns behaviors, they will need to be configured with specific properties. Be sure that for both the recordsets that you create, you have the following properties set in the Property Inspector:
  • Cursor Type is set to Dynamic.
  • Cursor Location is set to Client.
  • Lock Type is set to Optimistic.


Additional recordsets used by the Set Selected in List behavior

When you wish to set selected values in a dynamically populated list, you are further limiting the amount of data you wish to work with, so it is necessary to filter the data you wish to use. If that information is dynamic, it is necessary to create a third recordset.

Before applying the Set Selected in List behavior, you must define this additional recordset. Create a recordset that filters all the child list database entries against the criteria you wish to use to dynamically select options. This will retrieve that information for use by the server behavior when the page is loaded.

Example: The two figures below show an example of a recordset that filters against an additional column in a Child table.

The first figure shows the database structure (see Database structure for more information).

The second is the user interface for the recordset server behavior.

Note: It is not necessary for the information that is filtered against, to exist in the same table as the Child table. As long as the separate table that correlates the comparison information to the original table references the unique key for the records to be filtered, the comparison will still be valid (e.g. a new table called Child Gender with two columns: ChildID and Gender).