cfinvoke and cfinvokeargument - invoke a method of a component
cfinvokeargument.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfinvoke and cfinvokeargument tag example: how to invoke a method of a component</title>
</head>
<body>
<h2 style="color:DodgerBlue">ColdFusion cfinvoke and cfinvokeargument example</h2>
<cfinvoke
component="TableData"
method="GetTableData"
returnvariable="qTableData"
>
<cfinvokeargument name="Table" value="Employees">
<cfinvokeargument name="Columns" value="FirstName,LastName,Email">
</cfinvoke>
<cfdump var="#qTableData#">
</body>
</html>
TableData.cfc
<cfcomponent hint="Table Data Viewer">
<cffunction name="GetTableData" access="remote" returntype="query">
<cfargument name="Table" type="string" required="yes">
<cfargument name="Columns" type="string" required="yes">
<cfquery name="qTable" datasource="cfdocexamples">
SELECT #arguments.Columns# FROM #arguments.Table#
</cfquery>
<cfreturn qTable>
</cffunction>
</cfcomponent>
- display data in a flash format grid
- display data in a applet format grid
- display data in a html format grid
- cflocation - How to redirect a page with token
- cfquery - How to insert data
- cfdbinfo - How to get table name list from a data source
- cfdbinfo - How to get system table name list from a data source
- cfdbinfo - How to get column list from a table