Difference between revisions of "CEData 1 0-getCEData"
From ADF Docs
Gcronkright (talk | contribs) |
Gcronkright (talk | contribs) |
||
Line 79: | Line 79: | ||
== Examples == | == Examples == | ||
− | The getCEDdata function is handy way to get | + | The getCEDdata function is handy way to get data out of a CommonSpot Custom Element. Making a call to this method will return an Array of Structures of the data contained in the element specified. |
− | + | === Usage === | |
− | === | + | Example 1: Use getCEData to get ALL the Custom Element data: |
− | |||
<source lang="cfm"> | <source lang="cfm"> | ||
− | + | <cfscript> | |
− | // custom element | + | // get data form the "My Element" custom element |
− | data = application.ADF.ceData.getCEData("My Element" | + | data = application.ADF.ceData.getCEData( |
− | + | customElementName="My Element" | |
− | + | ); | |
− | + | </cfscript> | |
− | + | <cfloop from="1" to="#arrayLen(data)#" index="itm"> | |
− | <!---// renders the | + | <!---// renders data from the uniqueID and Title fields from the element ---> |
− | <cfoutput># | + | <cfoutput>#data[itm].values.uniqueID# #data[itm].values.Title#</cfoutput> |
− | + | </cfloop> | |
</source> | </source> | ||
− | --> | + | Example 2: Use getCEData to get records that match provide criteria: |
+ | <source lang="cfm"> | ||
+ | <cfscript> | ||
+ | // get data form the "My Element" custom element | ||
+ | data = application.ADF.ceData.getCEData( | ||
+ | customElementName="My Element", | ||
+ | customElementFieldName="uniqueID", | ||
+ | item='DF6D9B32-1143-FF53-952805B368AB301B' | ||
+ | ); | ||
+ | </cfscript> | ||
+ | |||
+ | <cfloop from="1" to="#arrayLen(data)#" index="itm"> | ||
+ | <!---// renders data from the uniqueID and Title fields from the element ---> | ||
+ | <cfoutput>#data[itm].values.uniqueID# #data[itm].values.Title#</cfoutput> | ||
+ | </cfloop> | ||
+ | </source> |
Revision as of 21:19, 13 August 2010
Attention: Do not change any text in the description, signature, and paramter sections.
Return to CEData_1_0
Description
Returns array of structs for all data matching the Custom Element.
Signature
public array getCEData ( string customElementName, string customElementFieldName, any item, string queryType, string searchValues, string searchFields )
Parameters
Required | Name | Type | Description |
required | customElementName | string | |
optional | customElementFieldName | string | [Default: ] |
item | any | [Default: ] | |
queryType | string | [Default: selected] | |
searchValues | string | [Default: ] | |
searchFields | string | [Default: ] |
Examples
The getCEDdata function is handy way to get data out of a CommonSpot Custom Element. Making a call to this method will return an Array of Structures of the data contained in the element specified.
Usage
Example 1: Use getCEData to get ALL the Custom Element data:
<cfscript>
// get data form the "My Element" custom element
data = application.ADF.ceData.getCEData(
customElementName="My Element"
);
</cfscript>
<cfloop from="1" to="#arrayLen(data)#" index="itm">
<!---// renders data from the uniqueID and Title fields from the element --->
<cfoutput>#data[itm].values.uniqueID# #data[itm].values.Title#</cfoutput>
</cfloop>
Example 2: Use getCEData to get records that match provide criteria:
<cfscript>
// get data form the "My Element" custom element
data = application.ADF.ceData.getCEData(
customElementName="My Element",
customElementFieldName="uniqueID",
item='DF6D9B32-1143-FF53-952805B368AB301B'
);
</cfscript>
<cfloop from="1" to="#arrayLen(data)#" index="itm">
<!---// renders data from the uniqueID and Title fields from the element --->
<cfoutput>#data[itm].values.uniqueID# #data[itm].values.Title#</cfoutput>
</cfloop>