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.
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:
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).
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:- Parent list options (ParentText from Database Structure lesson)
- Unique ID for each list option in your Parent List (ParentID from Database Structure lesson)
Child recordset
Create a recordset that retrieves from your Child Table:- Child list options (ChildText from Database Structure lesson)
- Unique ID for each list option in your Child List (ChildID from Database Structure lesson)
- Parent ID's for each Child list option (ParentID from Database Structure lesson)
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).