MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 240

Developing coldfusion mx applications
Table of Contents

Advertisement

Note: If a CFC is invoked using a URL or by submitting a form, ColdFusion MX returns the variable as
a WDDX packet. ColdFusion MX cannot return methods to Flash. Therefore, a CFC that is invoked
by Flash Remoting MX must not return the This scope.
You can return values of all data types, including strings, integers, arrays, and structures. The
tag returns a single variable, as does the
cfreturn
want to return more than one result value at a time, populate a structure with name-value pairs
and return the structure using the
For more information on using the
Documenting CFCs
ColdFusion provides several ways of including documentation about your CFCs in your
component definitions. The documentation is available when you use introspection to display
information about the CFC or call the
You can use the following tools for documenting CFCs:
The
displayname
User-defined metadata attributes
The
cfproperty
The following sections describe these tools. For information on displaying the information, see
"Introspection: getting information about components" on page
The displayname and hint attributes
The
cfcomponent
attributes.
hint
The
displayname
attribute, function, or property. When you use introspection, this attribute appears in parentheses
next to the component or method name, or on the parameter information line.
The
attribute is intended for longer descriptions of the component, function, or argument.
hint
In the introspection display, it appears on a separate line or on several lines of the component or
function description, and at the end of the argument description.
Metadata attributes
You can include arbitrary metadata information as attributes of the
, and
cfargument
Meta_TextType
here as a convention.) This attribute is not used as a function parameter; instead, it indicates that
this method generates a form with a Text Area.
<cffunction name="makeForm" Meta_TextType="TextArea">
Metadata attributes are not used by ColdFusion MX for processing, and are not displayed by the
standard ColdFusion introspection displays; however, you can access and display them by using
the
GetMetaData
structure of the CFC element.
Metadata attributes are not useful just for documentation. Your application can use the
function to get the metadata attributes and act based on the values. For example, a
GetMetadata
mathCFC component might have the following
<cfcomponent displayname="Math Functions" MetaType="Float">
240
Chapter 11: Building and Using ColdFusion Components
cfreturn
cfreturn
and
attributes
hint
tag
,
,
cffunction
cfargument
attribute is lets you provide a more descriptive name for a component,
tags. For example, in the following
cfproperty
attribute is a metadata attribute. (The prefix Meta_ is not required, it is used
function to get the metadata. Each attribute name is a key in the metadata
CFScript statement. Therefore, if you
return
tag.
tag, see CFML Reference.
method to get the component's metadata.
getMetadata
, and
cfproperty
cfcomponent
233.
tags have
displayname
,
cfcomponent
cffunction
tag the
cffunction
tag:
and
,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents