Operation Manual

Table Of Contents
691
Building applications visually
Last updated 11/30/2015
Later, the store announces a special promotion: free shipping for all orders above $100. You make the change to the
shipping rates in one place—the ShippingCharge function of the Pricing component—and all the pages using the
function automatically get accurate shipping charges.
Components panel overview (ColdFusion)
Use the Components panel (Window > Components) to view and edit ColdFusion components, and add code in the
page that invokes the function when the CFM page is requested.
Note: The Components panel is available only when viewing a ColdFusion page in Dreamweaver.
Create or delete a CFC in Dreamweaver
You can use Dreamweaver to visually define a CFC and its functions. Dreamweaver creates a .cfc file and inserts the
necessary CFML tags for you.
Note: Depending on the component, you may have to complete some code by hand.
1 Open a ColdFusion page in Dreamweaver.
2 In the Components panel (Window > Components), select CF Components from the pop-up menu.
3 Click the Plus (+) button, and complete the Create Components dialog box, and click OK.
a.In the Components section, enter the details about the component. Here is a partial list:
Name Specifies the filename of the component. The name must contain only alphanumeric characters and
underscores (_). Dont specify the .cfc file extension when entering the name.
Component Directory Specifies where the component is saved. Select the web applications root folder (such as
\Inetpub\wwwroot\myapp\) or any of its subfolders.
b.To define one or more functions for the component, select Functions from the Section list, click the Plus (+)
button, and enter the details of the new function.
Ensure that you specify the type of the value returned by the function in the Return Type option.
If you select remote from the Access menu, the function becomes available as a web service.
c.To define one or more arguments for a function, select Arguments from the Section list, select the function from
the pop-up menu, click the Plus (+) button, and enter the details of the new argument on the right.
4 If you use a remote development server, upload the CFC file and any dependent files (such as those used to
implement a function or include files) to the remote server.
Uploading the files ensures that Dreamweaver features such as Live view and Preview In Browser work properly.
Dreamweaver writes a CFC file and saves it in the folder you specified. The new component also appears in the
Components panel (after clicking Refresh).
5 If you use a remote development server, upload the CFC file and any dependent files (such as those used to
implement a function or include files) to the remote server.
View CFCs in Dreamweaver
Dreamweaver provides a way to visually examine the ColdFusion components (CFCs) located in your site folder or on
the server as a whole. Dreamweaver reads the CFC files and displays information about them in an easy-to-navigate
tree view in the Components panel.