Specifications
Chapter 16202
The Data Formatting API
applyFormat()
Availability
Dreamweaver UltraDev 1
Description
Adds a format function declaration to the user’s document. When a user chooses a format from
the Format field in the Dynamic Data or Dynamic Text dialog box or the Bindings panel,
Dreamweaver makes two changes to the user’s document: It adds the appropriate format function
before the HTML tag (if it’s not already there) and it changes the dynamic data object to call the
appropriate format function.
Dreamweaver adds the function declaration by calling the
applyFormat() JavaScript
function in the data format file. It changes the dynamic data object by calling the
formatDynamicDataRef() function.
The
applyFormat() function should use the DOM to add function declarations to the top of the
user’s document. For example, if the user chooses Currency - Default, the function adds the
declaration of the
Currency function.
This function can edit a user’s document.
Arguments
format
format
is a JavaScript object that describes the format to be applied. The JavaScript object is the
node that corresponds to the
<format> tag in the Formats.xml file. The object has a JavaScript
property for each attribute of the corresponding <format> tag.
Returns
Dreamweaver expects nothing.
applyFormatDefinition()
Availability
Dreamweaver UltraDev 1
Description
Commits the changes to a format created with the Edit Format dialog box.
Users can create, edit, or delete formats with the Edit Format List dialog box. This function is
called to commit any modifications that are made. It can also set other, arbitrarily named
properties on the object. Each property is stored as an attribute of the
<format> tag in the
Formats.xml file.
Arguments
format
format
is a JavaScript object that corresponds to this format. The function must set the
expression property of the JavaScript object to be the regular expression for the format. The
function can also set other, arbitrarily named properties of the object. Each property is stored as
an attribute of the
<format> tag.