Specifications

199
CHAPTER 16
Server Formats
Data Sources on page 191 discusses how Dreamweaver MX inserts dynamic data into the users
document by adding a server expression at the appropriate location. When a visitor requests the
users 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 user
can format how this dynamic value is presented to the visitor.
This chapter discusses the API that is used to format the dynamic data returned by the functions
that are described in Data Sources on page 191. Functions that are described in both chapters
work together to format dynamic data. If the user chooses a format for the dynamic data,
Dreamweaver calls the Data Source function
generateDynamicDataRef(), which is described in
Data Sources on page 191, to get the string to be inserted into the users document. Before
inserting the string into the users document, Dreamweaver passes that string to
formatDynamicDataRef(), which is described in this chapter. The string that the
formatDynamicDataRef() function returns is the formatted dynamic data that is finally inserted
in the users document.
The user can format dynamic data several ways. By using the Format menu in the Dynamic Data
or Dynamic Text dialog box or 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.
To illustrate, suppose you want 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 their values. When you create a new currency
format, youre prompted for the required values.
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 format types they created.