Hello All,
Ive been working with reactor trying to replace the ContactDAO.cfc and
Contact.cfc files from Flexs Contact Manager example with Reactors 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
Ive 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 Ive been using for
testing:
<!--- start of file --->
<cfscript>
//flex Assembler
asm = Createobject("component", "samples.contact.ContactAssembler");
//literally returns the iterators 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 Im trying to do what Im doing.
I havent 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 Im 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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --