Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 851

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
<cfcomponent>
<cffunction name="getLNames" access="remote" returntype="array" output="false">
<cfargument name="suggestvalue" required="true">
<!--- The function must return suggestions as an array. --->
<cfset var myarray = ArrayNew(1)>
<!--- Get all unique last names that match the typed characters. --->
<cfquery name="getDBNames" datasource="cfdocexamples">
SELECT DISTINCT LASTNAME FROM Employees
WHERE LASTNAME LIKE <cfqueryparam value="#suggestvalue#%"
cfsqltype="cf_sql_varchar">
</cfquery>
<!--- Convert the query to an array. --->
<cfloop query="getDBNames">
<cfset arrayAppend(myarray, lastname)>
</cfloop>
<cfreturn myarray>
</cffunction>
<cffunction name="getFNames" access="remote" returntype="array"
output="false">
<cfargument name="suggestvalue" required="true">
<cfargument name="lastName" required="true">
<cfset var myarray = ArrayNew(1)>
<cfquery name="getFirstNames" datasource="cfdocexamples">
<!--- Get the first names that match the last name and the typed characters. --->
SELECT FIRSTNAME FROM Employees
WHERE LASTNAME = <cfqueryparam value="#lastName#"
cfsqltype="cf_sql_varchar">
AND FIRSTNAME LIKE <cfqueryparam value="#suggestvalue & '%'#"
cfsqltype="cf_sql_varchar">
</cfquery>
<cfloop query="getFirstNames">
<cfset arrayAppend(myarray, Firstname)>
</cfloop>
<cfreturn myarray>
</cffunction>
</cfcomponent>
Issue with numeric data
For CFC methods that returns numeric data with a leading zero, for example, zip code
by the bind expression as an octal number and its decimal equivalent (in this case
. To resolve this issue, for URL binds or binds routed by way of a JavaScript function (for
returnformat="string"
example, using cfajaxproxy), you can set
stripped from the suggestion list for autosuggest controls.
Using the cfslider tag
The
tag places a slider control, for selecting a numeric value from a range, in a ColdFusion form. The slider
cfslider
can be used within a
cfform
forms.
returnformat=plain
tag for forms in HTML and applet format. The
Last updated 1/20/2012
02674
) even if you set
1468
to retain the numeric value. Also, leading zeros are
is not supported with Flash
cfslider
846
, the zero is interpreted

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents