Gareth - IT CAN BE DONE

This will do what you want. just modify the technique to apply the data
against the template - I have done a simple merge here.

----------tester.cfm page ---------------------

<cfscript>
// dim up an arry of objects for the repeater tag

aObjects = arrayNew(1);
stObject = structNew();
stObject.FName  = "Elliot";
stObject.LName  = "Russo";
stObject.ID  = "1";

for (i = 1; i lte 26; i = i + 1)
{
 stObjectI = duplicate(stObject);
 stObjectI.ID = i;
 stObjectI.LName = stObjectI.LName & "[#chr(i + 64)#]";
 arrayAppend(aObjects,stObjectI);
}
</cfscript>

<cfoutput>
<html>
<head>
 <title>Test</title>
</head>

<body>
<table>
<tr>
 <td>ID</td>
 <td>First Name</td>
 <td>Last Name</td>
</tr>
<cf_repeater aObjects="#aObjects#">
<tr>
 <td>{{ID}}</td>
 <td>{{FName}}</td>
 <td>{{LName}}</td>
</tr>
</cf_repeater>
</table>
</body>
</html>
</cfoutput>


---------------cftag repeater -------------------------

<cfparam name="attributes.aObjects">

<cfif thisTag.executionMode eq "start">

 <cfset iNumItems = arraylen(attributes.aObjects)>
 <cfset iCurrentIndex  = 1>

 <cfset stObject = attributes.aObjects[iCurrentIndex]>
 <!--- <cfinclude template="repeater_start.cfm"> --->

<cfelse>

 <cfset myRowContent = thisTag.generatedContent>

 <cfloop collection="#stObject#" item="key">
  <cfset myRowContent = replaceNoCase(myRowContent, "{{#key#}}",
stObject[key], "ALL")>
 </cfloop>

 <cfset  thisTag.generatedContent = myRowContent>

 <cfif iCurrentIndex lt iNumItems>

  <!--- cause it doesn't reenter the start section ! --->
  <cfset iCurrentIndex = iCurrentIndex + 1>
  <cfset stObject = attributes.aObjects[iCurrentIndex]>

  <!--- <cfinclude template="repeater_start.cfm"> --->

  <cfexit method="loop">

 </cfif>

</cfif>

"Gareth Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

is there ANY way of creating a custom repeater wrapper in coldfusion?

ie.

<CUST:cf_repeater type="simple" count="10">
  content here to loop over.
</CUST:cf_repeater>

So far I've found it cant be done, please if someone knows a way without
doing it in java or c++.. let me know.

Gareth.




---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to