Using ColdFusion Studio ColdFusion Studio 4.
Copyright Notice © 1999 Allaire Corporation. All rights reserved. This manual, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Allaire Corporation.
Contents Welcome to ColdFusion Studio .......................... xi Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii Introduction to the ColdFusion 4.5 Web Application Server . . . . . . . . . . . . . . . . . xii Development Features in ColdFusion Studio 4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . xiii About ColdFusion Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iv Contents Chapter 2 Managing Files ............................. 29 About the Files Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Working with Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting startup options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Opening files . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter v Chapter 6 Writing Code and Web Content .............. 53 Inserting Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Inserting tags from the QuickBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Selecting tags from the Tag Chooser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Selecting a Color Coding Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vi Contents Data Exchange Across Application Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Time Zone Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 How WDDX Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Converting CFML Data to a JavaScript Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter vii Chapter 11 Using Projects for Site Management ....... 101 What is a Project? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Working in the Project Resources Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Configuring project options . . . . . . . . . . . . . . . . . . . . . . .
viii Contents Building Tag Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Populating dialog boxes with tag data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Generating a tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables passed to the layout template . . .
Welcome to ColdFusion Studio ColdFusion Studio is a powerful and flexible tool for building, testing, and deploying dynamic Web applications. It is also an easy to use tool to create and edit Web content, with support for a variety of scripting languages. Contents • Intended Audience...................................................................................................... x • Introduction to the ColdFusion 4.5 Web Application Server...................................
x Intended Audience Intended Audience The principal audience for this user guide is professional Web developers who have a working knowledge of HTML and Web server environments. The focus is on introducing you to Studio’s interface and development tools. Introduction to the ColdFusion 4.5 Web Application Server The ColdFusion 4.
Welcome to ColdFusion Studio xi Development Features in ColdFusion Studio 4.5 A wide range of features are available in ColdFusion 4.5 for application development and for creating Web content. Allaire FTP & RDS — Manage all your files from a single interface that integrates access to the Windows file system, ColdFusion server via Remote Development Servers (RDS), and FTP servers.
xii About ColdFusion Documentation About ColdFusion Documentation ColdFusion documentation is designed to provide support for all components of the ColdFusion development system. Both the print and online versions are organized to allow you to quickly locate the information you need. In addition to the book set, the documentation is provided in two other formats: • HTML — Browser-based Help references.
Welcome to ColdFusion Studio xiii Using ColdFusion Studio Documents everything you need to know about using ColdFusion Studio, including features like projects, source control integration, as well as the Studio workspace and interface. Quick Reference to CFML A valuable quick reference to CFML tags, functions, and variables. ColdFusion Server online documentation To view the HTML documentation, open the following URL: http://127.0.0.1/ cfdocs/dochome.htm.
xiv Developer Resources Developer Resources This section is a brief listing of CFML resources. Allaire ColdFusion Developer Center The Developer Center at http://www.allaire.com/developer/referenceDesk/index.cfm contains all the latest information on ColdFusion and offers tutorials, technical articles, and links to other resources. ColdFusion Web Resources Following are just a few of many site dedicated to CFML development. • CF Advisor Online at http://www.cfadvisor.com/api-shl/engine.cfm.
Welcome to ColdFusion Studio xv Contacting Allaire Please contact Allaire for sales and support information. Corporate headquarters Allaire Corporation 275 Grove Street Newton, MA 02446 Telephone: 617.219.2000 Fax: 617.219.2001 http://www.allaire.com Customer Service Contact Allaire customer service to inquire about product orders and to obtain corporate and product information and an Allaire username and password. Hours: 8:00 AM to 8:00 PM Eastern time. Toll Free US & Canada: 888.939.
xvi Contacting Allaire
CHAPTER 1 Exploring the Workspace This chapter acquaints you with the main areas of the interface. It will also give you some pointers on customizing the workspace to make all your development work as productive as possible. Contents • The Workspace Areas ................................................................................................ 18 • Working in the Resource Windows ..........................................................................
The Workspace Areas The term Workspace describes the user interface that you see when you first load the program. The workspace has four principal areas: • Command area — At the top of the workspace is the title bar, which displays the file path of the current document. Below that is the menu bar, which contains standard Windows commands plus development menus. Below the menus are toolbars that provide one-click access to commands and application tools.
Exploring the Workspace 19 Setting workspace options Selecting Options > Settings (F8) opens the control center for user preferences. By navigating the feature tree in the left pane, you can view and change options for file management, coding, and testing applications and Web content. Working in the Resource Windows The Resource window is a multipanel interface that lets you switch easily among development resources as you build site content. Several of the panels contain their own toolbars.
Creating and Browsing Files in the Document Window The Document window is where code and other content are entered and edited. Edit tab The Editor has many productivity features for creating and editing code, content, and navigation structures. You can easily insert tags, generate code, and add content from text files, Microsoft Office applications, or directly from the Web. You can easily create templates to insert common content.
Exploring the Workspace 21 Tracking Your Work in the Results Window The Results window presents the results of document operations in individual panels. It opens automatically when you run Search, Code Validation, Link Verification, Image Thumbnails, or Project Deployment. You can also open it from the View menu. Right-click in any of the panels to open a context menu.
Printing Help topics If you are using Internet Explorer as the internal browser, you can print a Help topic by right-clicking the document in Browse mode and selecting Print. The default internal browser does not support printing. Bookmarking Help topics You can get quick access to Help documents by bookmarking them. Bookmarks can be assigned to documents in the Help tree and to HTML documents in the file system or on the Internet.
Exploring the Workspace 23 2. Enter a word or phrase in the Enter the word(s) to find box. For information on using search operators, click the Search Tips button. 3. To limit the references searched, select the Search only in selected references option and select the check box next to one or more references. 4. Click the Search button. The Help References pane shows the search results. 5. Double-click a document in the results list to open it.
To create a new folder in the Help tree: 1. Open the Files panel in the Resources window. 2. Navigate to the Help folder of your installation. 3. Right-click in the files pane and select the Create Folder menu item to open a new folder box in the directory pane. 4. Type a folder name in the box and press Enter to save the new folder. You might need to press F5 to refresh the Help display.
Exploring the Workspace 25 Adding Help References to the booktree structure If you add a folder to the Help directory, the folder appears at the bottom of the Help References list. For most users, this is all you need. If, however, you want to control the display order of the Help References, you can edit the booktree.xml file in the Help root directory. The booktree structure uses a simple tag set to configure the Help display on the book, chapter, and page level.
Adding media content You have considerable flexibility in adding supporting files (such as graphics, animations, video, and sound) to Help documents. One approach is to create a file structure in the Help tree that conforms to the media file references in your documents. Alternately, you can supply a URL or accessible file location for remote files. Be aware that if you are using the default internal browser or an older external browser, proper playback of media files is limited.
CHAPTER 2 Managing Files This chapter shows you how to work with folders and files. Contents • About the Files Tab.................................................................................................... 28 • Working with Files..................................................................................................... 29 • Changing the File List Display.................................................................................. 31 • Dragging Files from Windows Explorer .........
About the Files Tab Creating a project is the best way to organize files when developing a Web site or Web applications (see “Using Projects for Site Management” on page 91), but for general file management chores, you work in the Files tab on the Resources window. The Files tab gives you access to servers, drives, directories, and files without having to go to Windows Explorer.
Managing Files 29 Working with Files You can use the following procedures to work with files, regardless of their location (local drive, network drive, or remote server). Setting startup options Open Options > Settings > Startup to select which files and folders open when load the program. Setting the startup file option You can select one of the these options: • Open all the documents that were open when you closed the program. • Open the project that was open. • Open a blank document.
Adding a link to an open file To create a link to a file: 1. Open the page you want to place the link in the Editor window. 2. Drag the file you want to create a link to from the file list to the page in the Editor window. Release the mouse button when the cursor is in the location where you want the link to be added. Note Alternatively, you can right-click a file and choose Insert As Link from the shortcut menu. The link is inserted in the current page at the cursor location.
Managing Files 31 Changing the File List Display You can arrange the file list to display exactly what you want. To filter the file list: 1. Right-click in the file list and choose Filter from the menu. 2. From the Filter submenu, choose the file type you want displayed: • • • • Note Web Documents displays Web documents only. Web Images displays Web images only (JPEG, JPG, PNG, and GIF). All Web Files displays both Web documents and Web images. All Files displays all files in the selected directory.
Building a Favorite Folders List You can build a list of favorite folders to make accessing their files easier. To add a folder to the favorites list: 1. Select the folder in the Directory List. 2. In the file list, right-click and choose Favorite Folders > Add Current Folder to Favorites. The folder is added to your favorites list for easy selection. To view a favorite folder: 1. Right-click in the file list and choose Favorite Folders from the menu. 2.
Managing Files 33 Working with Files on Remote Servers Working with directories and files on remote servers is virtually identical to working with them on local or network drives. The primary difference is that you need to establish a connection to a remote server before you can work with its files. The Allaire FTP & RDS feature lets you work with files on configured remote servers. See “Connecting to Servers via FTP and HTTP” on page 39 for setup procedures.
Downloading Web Pages You can download any HTML page and open it in the editor. These files cannot be saved back to the server. To open a page from a Web site: 1. Choose File > Open From Web. 2. Enter the URL for the page or select from your Bookmarks or Favorites list. 3. If the site is accessed via a proxy server, click Proxy and enter the server name and port number. 4. You can optionally set a time-out limit for the connection. 5. Click OK to open the file as an untitled document.
CHAPTER 3 Configuring Web Browsers This chapter contains the procedures for configuring Web browsers for use by ColdFusion Studio. Contents • Configuring the Internal Browser ............................................................................ 36 • Configuring External Browsers ................................................................................
Configuring the Internal Browser The following sections describe the choices available for browsing documents and processing pages from within ColdFusion Studio. Setting the internal browser options You can use the internal browser to view documents in a Web browser within the program. Open the Options > Settings > Browse pane to set options. You can select from these browser options: • If Microsoft Internet Explorer is installed on your system, you can use it as the internal browser.
Configuring Web Browsers 37 Installing Mozilla 1. Downloading the Mozilla binaries. 2. Unzip the Mozilla files into a new directory. 3. Add the Mozilla bin directory to your PATH environment variable and reboot if necessary. If you are using Win 95/98 you may have to specify the short name version of the path, such as, c:\mozil~1\bin If your Mozilla bin directory does not contain a file named component.reg or if that file is smaller than 5KB, then delete it and run mozilla.exe.
Configuring External Browsers As part of the installation process, ColdFusion Studio creates a list of Web browsers that it detects on your system. You can manage the list by selecting the Options > Configure External Browsers menu command. You can easily Add, Edit, and Delete browsers using this dialog box. The browser at the top of the list is the default. Select a browser and click the Up Arrow button to move it to the top of the list.
CHAPTER 4 Connecting to Servers via FTP and HTTP ColdFusion Studio provides FTP server access and secure HTTP access via Remote Development Services (RDS). You can perform file transfers and other file management tasks using either FTP or RDS. To access data sources and to run the debugger, an RDS server connection is required. Contents • Required Server Information.................................................................................... 40 • Connecting to an FTP Server........................
Required Server Information You will need specific information about a remote server to connect to it, such as host name and user access requirements. If you do not have this information, you need to get it from the owner of that server, whether it is your IT group, an ISP, or another provider. Connecting to an FTP Server The File Transfer Protocol (FTP) is the standard for transferring files between nodes on the Internet.
Connecting to Servers via FTP and HTTP 41 3. Enter the following information for the server you want to connect to: • • • • • • • • • • • Description — A descriptive name that will be displayed in the Files tab and in Windows Explorer. Host Name — The server’s domain name, such as allaire.com, or an IP address. Servers that include ftp as part of the domain name require that you enter the complete name, such as ftp.somesite.com.
Overview of Remote Development Services Remote Development Services (RDS) lets you communicate via HTTP with ColdFusion on the local machine and on any configured remote host. RDS features include: • Secure server access • Data source browsing and SQL query building • Remote file access • CFML debugging Managing ColdFusion security The ColdFusion installation configures basic security for the server and by default requires a password for the ColdFusion Administrator and for ColdFusion Studio.
Connecting to Servers via FTP and HTTP 43 Configuring an RDS Server Complete the following configuration procedure for each ColdFusion server you want to access. To configure an RDS server: 1. In ColdFusion Studio, click the Files tab at the bottom of the Resources window. 2. Open the Drive list at the top of the Files pane and select Allaire FTP & RDS. 3. Right-click Allaire FTP & RDS in the Directory list and select the Add RDS Server command to open the Configure RDS Server dialog box. 4.
Managing Servers You can easily change server configurations as needed. To view and edit the configuration for a server: 1. Right-click the server name in the Allaire FTP & RDS list and select Properties from the menu. 2. Make any changes necessary in the Configure Server dialog box and click OK. To delete a server: 1. Right-click the server name in the Allaire FTP & RDS list and select Delete Server from the menu. 2. Click Yes when you are asked to confirm that you want to delete the server.
CHAPTER 5 Adding Server Mappings Development mappings are essential for working with files via Remote Development Services (RDS). Contents • Understanding Development Mappings................................................................. 46 • Understanding RDS Mappings ................................................................................ 47 • Defining a Server Mapping.......................................................................................
Understanding Development Mappings Development mappings serve two purposes: • To enable server-based processing of pages from within ColdFusion Studio • To enable debugging of application code on a remote server via RDS Mapping for page processing By default, when you browse a document in the internal or external browser, it is opened from the local file system or returned via FTP from a remote server.
Adding Server Mappings 47 Understanding RDS Mappings File mappings ensure that ColdFusion Studio, the server, and your browser can properly resolve local paths into server paths and URLs. • Studio Path — How does ColdFusion Studio see the directory? • ColdFusion Path — How does the Web server/ColdFusion server see the directory? • Browser Path — How does the browser see the directory? The next section presents the most common mapping scenarios.
Using drive mappings Developers often debug against a remote server across an internal network. In many cases, they use a network drive mapping. For example, a user may have a remote drive X:\ mapped to a network shared directory \\MYSERVER\WEBPROJECTS\ where WEBPROJECTS is the name of the shared directory in the network server MYSERVER. In such a scenario, a file that appears to Studio as X:\App1\index.cfm Might be viewed by the server as C:\webprojects\App1\index.
Adding Server Mappings 49 ColdFusion Studio and the server need to understand how a file location appears to the parties involved. You therefore need to create a mapping for the App1 directory as follows: Studio accesses files on remote CF server using UNC paths/Network Neighborhood Studio path \\MYSERVER\WEBPROJECTS\App1\ Server path C:\webprojects\App1\ Browser/URL path http://215.180.21.
Defining a Server Mapping The debugger relies on these mappings to communicate the correct file paths of all files with breakpoints to the ColdFusion server. You create these mappings in the Mappings pane of the Remote Development Settings dialog box. To define a server mapping: 1. Open the Options > Settings > Browse pane. 2. Check either Microsoft Internet Explorer or Netscape’s Mozilla NGLayout as the internal browser. 3.
CHAPTER 6 Writing Code and Web Content ColdFusion Studio can handle many different Web development tasks, from writing simple HTML pages to designing, testing, and deploying complex, dynamic sites. This chapter describes some basic techniques for creating Web content and application code. Contents • Inserting Code ........................................................................................................... 52 • Selecting a Color Coding Scheme ................................................
Inserting Code The coding tools in ColdFusion Studio support the full range of writing styles, from typing to point-and-click, and you can set the level of support you want. For repetitive chores, you can use its productivity to quickly enter common code blocks and required text. If you’re working with less familiar syntax, you can get pop-up tips and selectable lists of language elements. Inserting tags from the QuickBar The QuickBar is a customizable development toolbar.
Writing Code and Web Content 53 Selecting tags from the Tag Chooser The Tag Chooser contains tag sets for languages that are supported by tag editors, the Tag Inspector, Tag Insight, and Tag Tips. To use Tag Chooser: 1. Right-click in the editor and select Insert Tag, or press Ctrl+E to open Tag Chooser. The left pane in Tag Chooser contains a list of supported languages, the right pane shows the individual tags for the selected language folder. 2.
Setting the supported file types for a scheme The color schemes for the supported languages are grouped by file extensions in the Color Coding pane. You can easily change the file types for a scheme. To modify file types for a scheme: 1. Open Options > Settings > Editor > Color Coding. 2. Select the scheme you want to change. 3. Click the Edit Extensions button to open the edit dialog box. 4. Edit the extensions list as need. Be sure to separate entries with a semi-colon. 5.
Writing Code and Web Content 55 Using Inline Tools to Enter Code You have a number of tools to help you easily insert new code and to edit existing code as you type. Each of these tools supports a distinct language element, such as tags, objects, and functions. Tag Insight This interactive feature can be used to write new code and to edit existing code. Open the Options > Settings > Editor > Tag Insight pane to configure it. To insert a tag using Tag Insight: 1.
Tag Completion When this feature is turned on, the end tag is automatically inserted for the start tag that you type. Open Options > Settings > Editor > Tag Completion to set the options. Auto Completion Auto Completion completes a code block by inserting the appropriate code when the opening code fragment (the trigger string) is typed. To enable this feature, open Options > Settings > Editor > Auto Completion. You can also add your own code blocks and set a cursor position option in this pane.
Writing Code and Web Content • • 57 Use Design mode to prototype page layouts and to quickly create HTML tables and forms and set font and image formatting. Open Options > Settings > Design to display the Design tab. Add hyperlinks to Web images (gif, jpg) with the Image Map Editor. To get started, open the Tools > New Image Map dialog box. Adding Document Content The default template contains just the code required for a valid HTML document.
To copy text from a browser: 1. To strip the HTML formatting code from copied text, select the Treat HTML dropped from external application as plain text option in Options > Settings > Editor. 2. Select the text in the browser that you want to copy. 3. Use the Windows copy and paste commands to enter the text block in the editor. To insert Microsoft Office content: • • To convert Office content, such as lists, tables, and worksheet cells, to plain text, select the content and copy it to the editor.
Writing Code and Web Content 59 Saving Code Blocks as Snippets With Code Snippets, you can easily store code blocks and content for reuse. Comment your snippets just as you would any code block. To create a code snippet: 1. Click the Snippets tab in the Resources window. Before adding a snippet, you need to create a folder. 2. Right-click in the Snippets panel and select Create Folder from the shortcut menu. 3. Enter a name for the folder. 4.
Sharing snippets You can share code snippets with other developers by giving them access to a shared folder on your machine or on another network machine. To create a shared snippets folder: 1. Open Options > Settings > Locations. 2. Enter a folder path for Shared Snippets and click OK. The new folder appears in the Snippets list. Anyone with access to the shared folder can now add, edit, and delete snippets.
CHAPTER 7 Accessing Data Sources This chapter describes how to use Studio’s visual tools to significantly accelerate development of data-driven ColdFusion applications. Contents • Introduction to Database Tools ............................................................................... 62 • Registering Data Sources .......................................................................................... 62 • Connecting to Data Sources .................................................................
Introduction to Database Tools Studio’s visual database tools support application development using both local, network, and remote data sources. Access to data sources becomes transparent when a server is configured in Studio.
Accessing Data Sources 63 Connecting to Data Sources Data sources registered in the ColdFusion Administrator are automatically accessible from Studio’s Database tab. You can also add remote ColdFusion servers (RDS) to connect to their data sources. To add a remote server: 1. Open the Database tab and select Add RDS server from the dropdown list in the top pane. 2. Complete the Configure RDS Server dialog.
Using SQL Builder Studio provides a powerful visual tool to build, test, and save SQL statements for use in data queries. Select a query type from the SQL Builder toolbar or right-click in the Table pane and choose from the Query Type list. To open SQL Builder choose one of these methods: • • • Right-click on a database or a table in the Database tab and choose New Query. Click Tools > SQL Builder, select a database from the dropdown list, and click New Query.
Accessing Data Sources 65 The SQL Builder is divided into four sections: • Toolbar — Contains icons for SQL keywords and commands. • Table pane — Provides a view of the tables in your query and allows you to create joins between tables. • Properties pane — Allows you to set the properties of the query such as the columns that are being selected or the columns that are being updated. • SQL pane — Shows you the SQL statement as it is built.
Building a SELECT Statement SQL SELECT statements let you specify the data from which to build a recordset. This procedure begins with SQL Builder open. To optimize performance, tables are only retrieved on an as needed basis. To create a SELECT statement: 1. Select the first table you want to query. 2. Right-click in the Table pane and choose Add Table or click the Add Table button in the tool bar to add additional tables to the query. 3. Drag and drop column names between tables to create joins. 4.
Accessing Data Sources 67 Testing a Query You can test your SQL code in SQL Builder before inserting it in a page. To run a query in the SQL Builder: 1. Click the Run Query button. 2. You are prompted to enter values for any CFML variables in the query. Note When you click the Run Query button, the SQL statement is actually processed. If you run an INSERT, UPDATE, or DELETE statement, the changes you coded in the SQL statement are made in the data source.
Inserting SQL into a Page You can use any of the following methods to insert a query directly into a CFML page from the SQL Builder: • If you open the SQL Builder from the CFQUERY tag editor, it prompts you to insert the query when you close the editor. • If you open the SQL Builder from a CFML page, it prompts you to insert the query when you close it. • To insert just the SQL statement, click the Copy SQL to Clipboard button on the toolbar. Close the SQL Builder and paste the SQL into your page.
CHAPTER 8 Exchanging Data via XML You can now move complex data structures across the Web using Web Distributed Data Exchange (WDDX). This new capability is based on XML 1.0 and can be used to exchange data between CFML applications and other applications. Additionally, server-to-browser and browser-to-server JavaScript data exchanges can be instantiated using WDDX.
An Overview of Distributed Data for the Web Web Distributed Data Exchange (WDDX) is an Extensible Markup Language (XML) vocabulary for describing complex data structures such as arrays, associative arrays, and recordsets in a generic fashion so they can be moved between different application server platforms and between application servers and browsers using only HTTP.
Exchanging Data via XML 71 versioning, allowing these and other enhancements to be folded into the specification as they become available without disrupting working applications. Working with Application-Level Data The real strength of WDDX is clear if the client and server are seen as a unified platform for applications. This is a subtle, but profound, distinction from the traditional view of an application where services are partitioned between the client and server.
In the CFML implementation, useTimezoneInfo is a property of the CFWDDX Action=Cfml2WDDX tag. In the COM implementation, useTimezoneInfo is a property of the IWDDXSerializer interface provided by the object WDDX.Serializer.1. In the JS implementation useTimezoneInfo (note the case-sensitivity of JS) is a property of the WDDXSerializer object. Date-time values in WDDX are represented using a subset of the ISO8601 format. Timezone information is represented as an hour/minute offset from UTC, e.g.
Exchanging Data via XML 73 Converting CFML Data to a JavaScript Object The following example demonstrates the transfer of a CFQUERY result set from a CFML template executing on the server to a JavaScript object that is processed by the browser.
o += "
"; for (i = 0; i < colNames.length; ++i) { o += "" + colNames[i] + " | "; } o += "
"; for (row = 0; row < nRows; ++row) { o += ""; for (i = 0; i < colNames.length; ++i) { o += "" + r.getField(row, colNames[i]) + " | "; } o += "
"; } o += "
"; // Write the table to the HTML stream document.Exchanging Data via XML 75 Transferring Data from Browser to Server This example serializes form field data, posts it to the server, deserializes it, and outputs the data. For simplicity, only a small amount of data is collected. In applications where complex JavaScript data collections are generated, this basic approach can be extended very effectively.