User Guide

307
CHAPTER 17
Server Formats
Chapter 16, “Data Sources,” on page 293, discusses how Macromedia Dreamweaver MX 2004
inserts dynamic data into a users document by adding a server expression at the appropriate
location. When a visitor requests the document from the web server, that server expression is
converted to a value from a database, the contents of a request variable, or some other dynamic
value. The Dreamweaver server formats let you format how this dynamic value is presented to
the visitor.
This chapter discusses the API that formats the dynamic data that is returned by the functions
described in “Data Sources. The functions that are described in both chapters work together to
format dynamic data. If the user selects a format for the dynamic data, Dreamweaver calls the
data source function
generateDynamicDataRef(), see generateDynamicDataRef()”
on page 297, to get the string to insert into the user’s document. Before inserting the string into
the user’s document, Dreamweaver passes that string to the
formatDynamicDataRef() function,
which is described in this chapter. The string that the
formatDynamicDataRef() function
returns is the formatted dynamic data that is finally inserted in the user’s document.
Dreamweaver users can format data with built-in formats, create new formats that are based on
built-in format types, or create new formats that are based on custom format types.
The user can format dynamic data in several ways. By using the Format menu in the Dynamic
Data or the Dynamic Text dialog box or in the Bindings panel, the user can format the data
before inserting it into an HTML document. If the user wants to create a format, he or she can
select the Edit Format List command from the Format menu and select a format type from the
Plus (+) menu. The Plus (+) menu contains a list of format types. Format types are basic format
categories, such as Currency, DateTime, or AlphaCase. Format types collect all the common
parameters for a category of format, letting you streamline the work to create a new format.
One example might be to create a new currency format. Essentially, all currency formatting
consists of converting a number to a string, inserting commas and decimal points, and inserting a
currency symbol, such as a dollar ($) sign. The Currency format data type collects all the common
parameters and prompts you for the required values.