This content has been marked as final. Show 1 reply
I don't know if I properly understood your post but you don't really need a CFC to accomplish that. Second, this is the advanced forum, so this is not the right forum for an issue of this nature. Again, you didn't really explain why you need a CFC but I will try to reply to your post in the best of my abilities despite the lack of details in the information you provided.
First of all, let's talk about CFCs. CFC is a coldfusion component and in my daily tasks I use CFCs to put together all the functions I use in the system and to put together some special functionality that I repeatedly use in my system. There are other uses depending on your system. What's your scenario? You can call CFCs by including it in your cfm files through <cfinclude>, by using <cfinvoke>, or by invoking your CFC in your session scope (those are the scenarios where I call my CFCs on a daily basis, this doesn't mean they are the only tecniques allowed.)
But to accomplish what you want to accomplish you need two functions. Imagine that you created the function getGroups(), and get GroupMembers()
<cfloop index="idx" from="1" to="#getGroups.recordcount#">
<cfquery name="getMembersofGroup" datasource="#application.dsn#" dbtype="query">
select * from groupmembers where group="#getGroups.groupId[idx]#"
<div id="divId_#idx#" onClick="JSFunctionThatShowandHidesDiv();">
<cfloop index="ind" from="1" to="#getMembersofGroup.recordcount#">
I hope this helps and like I said, you did not really explain what you were trying to accomplish with your CFCs.
Have a nice day!