Sam – reasonably solid.  Solid enough that I’d like people to tell me what problems they find.

 

Looking at that red block of code, there should be something in there that insures that variables.children.company exists….

 

…. Pause …

 

Looked at the xsl and think I see the error.  No time to fix and test now, in the mean time call getCompany().getCompanyId()

 

Doug


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Clement
Sent: Tuesday, April 18, 2006 5:56 PM
To: [email protected]
Subject: Re: [Reactor For CF] New Commit committed

 

Hi Doug,

Is the latest SVN code meant to be solid?  If so, I've noticed a weird problem - if not, feel free to ignore the following:

I'm prototypying something pretty simple with 2 tables so far: company & user.

Here is the reactor.xml to show how they relate:
<objects>
        <object name="company" />
       
        <object name="user">
            <hasOne name="company">
                <relate from="companyid" to="companyid" />
            </hasOne>
        </object>
</objects>

Now when I try to process a form and use the method variables.userRecord.setCompanyid() in my MG controller I receive this error:

Element CHILDREN.COMPANY is undefined in VARIABLES.
D:\Webroot\reactor\project\myProject\Record\userRecord.cfc (189)

If I take out the relationship defined in the reactor.xml, the error goes away (but then so does the relationship!)

Investigating the generated userRecord.cfc, I see the following:

<!--- companyid --->
        <cffunction name="setcompanyid" hint="I set the companyid value  and reset related objects." access="public" output="false" returntype="void">
            <cfargument name="companyid" hint="I am this record's companyid value." required="yes" type="string" />
            
                    <!--- if the value passed in is different that the current value, reset the valeus in this record --->
                  
 <cfif arguments.companyid IS NOT getcompanyid()>
                        
                            <cfif variables.children.company IS NOT 0>

                                <cfset variables.children.company.resetParent() />
                            </cfif>
                            <cfset variables.children.company = 0 />
                        
                        
                    
    <cfset _getTo().companyid = arguments.companyid />
                        
                        <!--- load the correct address record --->
                        <cfset getAddress() />
                    </cfif>

                    
                
        </cffunction>

The code in red seems to be causing the problem, though not understanding the reactor framework, I can't figure out why.  Any insight would be appreciated.

Cheers,

Sam
-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to