User Guide
A simple data source example 299
inspectDynamicDataRef()
Availability
Dreamweaver UltraDev 1.
Description
Determines the corresponding node in the data source tree from a dynamic data object. The
inspectDynamicDataRef() function compares the string that Dreamweaver passes in to the
string that
generateDynamicDataRef() returns for each node in the tree. If a match is found,
the
inspectDynamicDataRef() function indicates which node in the tree matches the passed-in
string. The function identifies the node by using an array that contains two elements. The first
element is the name of the parent node, and the second element is the name of the child node. If
no match is found, the
inspectDynamicDataRef() function returns an empty array.
Each implementation of the
inspectDynamicDataRef() function checks only for matches of its
own object type. For example, the recordset implementation of the
inspectDynamicDataRef()
function finds a match only if the passed-in string matches a recordset node in the tree.
Arguments
string
• The string argument is the dynamic data object.
Returns
Dreamweaver expects an array of two elements (parent name and child name) for the matched
node; it returns a
null value if no matches are found.
A simple data source example
This extension adds a custom data source to the Bindings panel for ColdFusion documents. Users
can specify the variable they want from the new data source.
To create a new data source:
1 Create a data source definition file in HTML.
The data source definition file tells Dreamweaver the name of the data source as it will appear
in the Bindings Plus (+) menu and also tells Dreamweaver where to find the supporting
JavaScript files for the data source implementation.
2 Create an EDML file that defines the code Dreamweaver will insert into the document to
represent the data source value (for more information about EDML files, see “Server Behaviors”
on page 247).
3 Write the JavaScript code to implement the new data source.
4 Create any other supporting files, such as dialog boxes for user input or images to accompany
the data source in the Bindings panel.
This example creates a data source called MyDatasource, which includes a MyDatasource.js
JavaScript file that uses “The Data Sources API” on page 295 a MyDatasource_DataRef.edml file,
and MyDatasource Variable command files to implement a dialog box for users to input the name
of a specific variable. The MyDatasource example is based on the implementation of the Cookie
Variable data source and the URL Variable data source. The files for both these data sources reside
in the Configuration\DataSources\ColdFusion folder.