MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual page 102

Developing web applications with coldfusion
Table of Contents

Advertisement

76
7.
Open the file
The calling page uses the
Code Review
Code
<CFSET NameYouEntered="Smith">
<CF_GETMD NAME="#NameYouEntered#">
<CFPARAM VALUE="Attributes.Name"
DEFAULT="Who"
<CFSET CALLER.DOCTOR="Doctor " &
"#ATTRIBUTES.NAME#">
#ATTRIBUTES.NAME#
<CFSET DOCTOR="Doctor " &
"#ATTRIBUTES.NAME#">
<CFSET CALLER.DOCTOR="Doctor " &
"#ATTRIBUTES.NAME#">
Tip
Note
The Request scope is a reserved variable/scope that allows you to store data pertaining
to the complete hierarchy of custom tags used in a single page request. It is a structure
named "request." The variable is available to all templates: base, includes, and custom
tags. Collaborating custom tags that are not nested in a single tag can exchange data
via the request structure. You should assign a unique name for each variable. You
should store data in structures nested inside the request scope.
callingpage.cfm
custom tag and displays the results.
getmd
Be careful not to overwrite variables that might already exist on the
calling page. You should adopt a naming convention to minimize the
chance of overwriting variables. For example, prefix the returned variable
with customtagname_, with customtagname being the name of the
custom tag.
Data pertaining to the HTTP request or to the current application is
visible. This includes the variables in FORM, URL, CGI, COOKIES,
SERVER, APPLICATION, SESSION, and CLIENT scopes.
Developing Web Applications with ColdFusion
in your browser.
Description
In the calling page, create a variable
NameYouEntered and assign it the value
"Smith."
In the calling page, call the getMD
custom tag and pass it the NAME
parameter whose value is the value of
the variable NameYou Entered.
Assign the value "Who" to Name if it has
no value.
See below. (It is helpful to look at this
code from right to left.)
Get the value of the variable NAME from
the calling page
Create a variable called DOCTOR, make
its value "Doctor NAME"
Make the variable's scope CALLER so
that you can pass it back to the calling
page

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Coldfusion 4.5

Table of Contents