So I changed all of my instance variables inside my component to the 
variables scope.  After I did this everything seemed to work fine until 
I tried to reference my member object.  I'm calling the object with 
invoke in my FB4.1 circuit file like:

<invoke class="member" methodcall="get(url.memberid)" 
returnVariable="member" />

I used to reference my object on my dsp pages like member.fname and 
member.lname (when I was using the instance scope) but now that doesn't 
work anymore.  I get fname is undefined in member.

I'm guessing with my current component setup that I'll have to create a 
controller cfc or have a function in my member.cfc like getName and then 
say member.getname() on my dsp page to display the persons name.  Am I 
on the right track or am I missing something entirely?


Member.cfc component full listing---------------------------------------
<cfcomponent displayname="Member Entity">

        <cffunction name="init" access="public" output="false" 
returntype="membermanager.model.member">
                <cfargument name="aid" type="numeric" default="0">
                
                <cfset var member_select = 0/>          
                <cfset var member_last_update = 0/>
        
                <cfscript>
                variables.aid = arguments.aid;          
                variables.fname = "";
                variables.lname = "";                                           
                variables.company = "";
                </cfscript>
                
                <cfif variables.aid neq 0>
                        <cfquery name="member_select" maxrows="1" 
datasource="mp2">
                        select *
                        from members
                        where m_aid = <cfqueryparam value="#arguments.aid#" 
cfsqltype="cf_sql_integer">
                        </cfquery>
                        
                        <cfif member_select.recordcount eq 1>
                                <cfscript>
                                variables.aid = member_select.m_aid;            
                                                                                
                                variables.fname = member_select.m_fname;
                                variables.lname = member_select.m_lname;        
                                                                        
                                variables.company = member_select.m_company;
                                </cfscript>             
                        </cfif>
                </cfif>
                
                <cfreturn this>
        </cffunction>
        
        <cffunction name="get" access="public" output="false" 
returntype="membermanager.model.member">
                <cfargument name="aid" type="numeric" required="true">
                <cfset init(arguments.aid)>
                <cfreturn this>
        </cffunction>
</cfcomponent>

Mark Kecko
Technology Director
MediaPost Communications
[EMAIL PROTECTED]
212-204-2002

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get help! RoboHelp
http://www.houseoffusion.com/banners/view.cfm?bannerid=58

Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6741
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to