Hi there,
I have a Flex app where I pass an arraycollection to my cfc. I've been trying
to set the argument type as a 'struct' but I get an error stating that my
arraycollection is not of type struct. I've also tries setting it as an array.
No luck. Any thoughts?
Thanks.
Novian
Code:
<cffunction name="saveQuiz" access="remote" returntype="boolean" hint="Saves
new quiz to quiz_questions.">
<cfargument name="quizQuestion" type="string" required="yes">
<cfargument name="quizAnswer" type="string" required="yes">
<cfargument name="optionsAC" type="struct" required="yes">
<cfset var qRead="">
<cfquery name="savedQuizQuestion" datasource="my_db" result="savedQuizID">
INSERT into quiz_questions (quizQuestion, quizAnswer)
VALUES ('#ARGUMENTS.quizQuestion#', '#ARGUMENTS.quizAnswer#')
</cfquery>
<cfloop from="1" to="#ArrayLen(optionsAC.optionsArray)#" index="i">
<cfquery name="savedQuizOptions" datasource="my_db">
INSERT into quiz_options (quizID, optionName, correct)
VALUES ('#savedQuizID.GENERATED_KEY#', '#optionsAC.optionsArray[i].label#',
'#optionsAC.optionsArray[i].data#')
</cfquery>
</cfloop>
<cfreturn true>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:5248
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37