Use predefined data formats – Adobe Dreamweaver CC 2014 v.13 User Manual
Page 629
This example creates a record counter that appears similar to the example in “Simple record counters.” In this example, the text in sans-serif font
represents the record count placeholders that will be inserted in the page. The record counter in this example appears as follows:
Displaying records StartRow through EndRow of RecordSet.RecordCount.
1. In Design view, enter the counter’s text on the page. The text can be anything you want, for example:
Displaying records thru of .
2. Place the insertion point at the end of the text string.
3. Open the Server Behaviors panel (Window > Server Behaviors).
4. Click the Plus (+) button in the upper-left corner, and click Display Record Count. Within this submenu, select Display Total Records. The
Display Total Records behavior is inserted into the page, and a placeholder is inserted where the insertion point was. The text string now
appears as follows:
Displaying records thru of {Recordset1.RecordCount}.
5. Place the insertion point after the word records, and select the Display Starting Record Count Number from the Server Behaviors > Plus (+)
button > Record Count panel. The text string now appear as follows:
Displaying records {StartRow_Recordset1} thru of {Recordset1.RecordCount}.
6. Now place the insertion point between the words thru and of, and select the Display Starting Record Count Number from the Server
Behaviors > Plus (+) button > Record Count panel. The text string now appear as follows:
Displaying records {StartRow_Recordset1} thru {EndRow_Recordset1} of{Recordset1.RecordCount}.
7. Confirm that the counter functions correctly by viewing the page in Live view; the counter is similar to the following example:
Displaying records 1 thru 8 of 40.
If the results page has a navigation link to move to the next set of records, clicking the link updates the record counter to read as follows:
Showing records 9 thru 16 of 40.
Use predefined data formats
Dreamweaver includes several predefined data formats that you can apply to dynamic data elements. The data format styles include date and
time, currency, numerical, and percentage formats.
Apply data formats to dynamic content
1. Select the dynamic content placeholder in the Document window.
2. Select Window > Bindings to display the Bindings panel.
3. Click the down arrow button in the Format column.
If the down arrow is not visible, expand the panel.
4. From the Format pop-up menu, select the data format category you want.
Ensure that the data format is appropriate for the type of data you are formatting. For example, the Currency formats work only if the
dynamic data consists of numerical data. Note that you cannot apply more than one format to the same data.
5. Verify that the format was applied correctly by previewing the page in Live view.
Customize a data format
1. Open a page that contains dynamic data in Design view.
2. Select the dynamic data whose format you want to customize.
The bound data item whose dynamic text you selected is highlighted in the Bindings panel (Window > Bindings). The panel displays two
columns for the selected item—Binding and Format. If the Format column is not visible, widen the Bindings panel to reveal it.
3. In the Bindings panel, click the down arrow in the Format column to expand the pop-up menu of available data formats.
If the down arrow is not visible, widen the Bindings panel more.
4. Select Edit Format List from the pop-up menu.
5. Complete the dialog box, and click OK.
a. Select the format from the list, and click Edit.
b. Change any of the following parameters in the Currency, Number, or Percent dialog boxes, and click OK.
622