Hello All,
I’ve been working with reactor trying to replace the ContactDAO.cfc and 
Contact.cfc files from Flex’s Contact Manager example with Reactor’s Contact 
Manager Example for, at this point, a proof on concept using reactor to handle 
my data modeling in a flex data services app.

My Question: why would the first set of code successfully dump my component but 
the second set of code throw and error?
<!--- ContactRecord.cfc in my project files line 165 --->
<!--- this version of the function will correctly output the dump of the 
Transfer Object --->
<cffunction name="_getTo" access="public" output="true" returntype="any" 
_returntype="reactor.project.ContactManager.To.ContactTo">
                <cfif isDeleted()>
                        <cfthrow message="Record Deleted"
                                detail="The record you're using has been 
deleted.  There are some properties which will continue to function after a 
record has been deleted, but not all of them.  Please create a new record and 
go from there."
                                type="reactor.record.RecordDeleted" />
                </cfif>

                <cfif NOT StructKeyExists(variables, "to") >
                        <cfdump 
var="#_getReactorFactory().createTo(_getAlias())#">
                        <cfset variables.to = 
_getReactorFactory().createTo(_getAlias()) >
                </cfif>
                <cfabort>
                <cfreturn variables.to />
        </cffunction>

<!--- The following throws an error: The Selected Method createTo was not found 
~ And references the cfset variables.to line
        BTW  this is the code generated by reactor --->
<cffunction name="_getTo" access="public" output="true" returntype="any" 
_returntype="reactor.project.ContactManager.To.ContactTo">
                <cfif isDeleted()>
                        <cfthrow message="Record Deleted"
                                detail="The record you're using has been 
deleted.  There are some properties which will continue to function after a 
record has been deleted, but not all of them.  Please create a new record and 
go from there."
                                type="reactor.record.RecordDeleted" />
                </cfif>

                <cfif NOT StructKeyExists(variables, "to") >
                        <cfset variables.to = 
_getReactorFactory().createTo(_getAlias()) >
                </cfif>

                <cfreturn variables.to />
        </cffunction>

I might add too that if I add an abort before the return but after the 
variables.to cfset the code does not return an error. So it seems to be the 
combination of creating the To and trying to return it without going through 
the createRecord function.

Flex Calls the ContactManagerData.Record.ContactRecordmysql cfc directly so 
I’ve had to play with it to see what I could get out of it.
I have a short script to match what flex is doing that I’ve been using for 
testing:
<!--- start of file --->
<cfscript>
        //flex Assembler
asm = Createobject("component", "samples.contact.ContactAssembler");

//literally returns the iterator’s getArray Function
fillArray = asm.fill();
</cfscript>
<cfdump var=#fillArray#>
<!--- Flex Likes all this so far and has now populated a datagrid successfully 
in my swf file--->

<!--- this would be invoked when the Contact Object is created to start putting 
data back in --->
<cfinvoke component="ContactManagerData.Record.ContactRecordmysql" 
method="setcontactId" contactId="test">
<!--- end of file --->

Hope that gives a better idea of how I’m trying to do what I’m doing.
I haven’t found a way to pass an object back into flex from the createRecord() 
function, that seems like it would be a different path through the forrest.

Thanks for the Look,
Hopefully this makes half way sense of what I’m attempting to make happen.

Maybe I should mention I'm on the svn version of reactor hitting a MySQL5 
database.

Dan


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

Reply via email to