<CFCOMPONENT> Tag - ColdFusion


>> Return to CF Tag List

The <CFCOMPONENT> tag allows you ...


  <CFCOMPONENT> Comments from Macromedia LiveDocsLiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
This example doesn't help. I am confused with cfscript and cffunction and I can't find any infomation to solve my problems in this site.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
The list of attributes says
"displayname Optional name attribute value"
but the 'name' attribute is missing from the table

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
Can you use a list for the EXTENDS parameter? Can I have a component inherit from multiple parent classes?

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
EXTENDS is case-sensitive. We ran into this while changed the mach-ii core files to lowercase.
While this is not a bug, it's an inconvenience and should use the same algorithm than CFINVOKE:
"On UNIX systems, ColdFusion searches first for a file with a name that matches the specified component name, but is all lower case. If it does not find the file, it looks for a file name that matches the component name exactly, with the identical character casing."

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
Constructor info: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi36.htm
Scoping: Go to http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/buildi45.htm and click the right arrow key through the pages.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
I would like to see information about how a cfc is constructed (can you include a constructor method?) and how variables inside the cfc are treated (are they accessible via calling pages or not?).

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
>any comments on this example
You should include an example of creating a CFC:
<webroot>/com/myhost/myapp/example.cfc
and invoking as
com.myhost.myapp.example.function(args="an arg");
or similar.

Also using a CFC as a type in cfargument.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a16.htm
We are working to improve the examples in the ColdFusion reference pages. We propose to replace the current example on this page with the the following example. If you have any comments on this example, add them to this page.

<cfcomponent>
<cffunction name="getEmp">
<cfquery name="empQuery" datasource="ExampleApps" >
SELECT FIRSTNAME, LASTNAME, EMAIL
FROM tblEmployees
</cfquery>
<cfreturn empQuery>
</cffunction>

<cffunction name="getDept">
<cfquery name="deptQuery" datasource="ExampleApps" >
SELECT *
FROM tblDepartments
</cfquery>
<cfreturn deptQuery>
</cffunction>
</cfcomponent>

Assuming you save the code above in a file called managerCFC.cfc, you can invoke the component and view the return variable from another page with this code:

<cfinvoke component="managerCFC" method="getEmp" returnVariable="employees">
<cfdump var="#employees#">



[Top]


Recommended Books

[Top]

Web Sites

[Top]

Copyright © 2003- 2008, Orville Paul Chomer, All Rights Reserved