Another one of the wonderful powers in COOP is the ability to pass different data types and have the view handle them the same way. COOP supports three data types: lists, array of structures, and queries. Let's take a look at them one at a time. For these examples, we will not need a coprocessor. We will start with list data for our first code example using the same view page we have used before, but simplified a bit.
A list is just a string field with a delimiter separating one data element from the next. We can see that in this example, our string is the _init.persona
using the preDOM structure for the persona coop element tag passed in the data attribute. Save this file as dataswap.cfm
with the following code:
<cfimport prefix="coop" taglib="/share/tags/coop"/> <cfscript> _init.persona.data = "cook,carpenter,mechanic,salesman,accountant"; </cfscript> <coop:coop> <coop:css> #eventForm .coopFieldLabel { color:blue; text...