On 7/24/06, Christopher Jordan <[EMAIL PROTECTED]> wrote:
Thanks folks. I did manage to find another reference on Rob's site that talked about the "old" way of passing arguments like:
DWREngine._execute(_cfscriptLocation, null, 'cfFunctionName', arg1, arg2, arg3, ...., argN, jsResultFunctionName);
and then the new way as of releast 0.73(?)
DWREngine._execute(_cfscriptLocation, null, 'cfFunctionName', {"argName":arg1,..., "argName":argN}, jsResultFunctionName);
That ended up working for me. I did also see the option of creating the _javascript_ array object and passing it.
I don't know if this is a best practice for writing CFCs but I like to call them using name/value pairs, and so I code them something like this:
<CFFunction Name="SomeName" ReturnType="SomeReturnType">
<CFSet var Argument1 = "">
<CFSet var Argument2 = "">
<CFSet var ArgumentN = "">
<CFParam "Arguments.Argument1" Default="">
<CFParam "Arguments.Argument2" Default="">
<CFParam "Arguments.ArgumentN" Default="">
<CFSet Argument1 = Trim(Arguments.Argument1)>
<CFSet Argument2 = Trim(Arguments.Argument2)>
<CFSet ArgumentN = Trim(Arguments.ArgumentN)>
... rest of the function continues here...
</CFFunction>
Passing the arguments from _javascript_ in the "ArgName":arg1, ... method, worked well with how I'm accustomed to writing my CFCs to begin with. When I saw Rob's "arg1,arg2,arg3,... argN" example I felt stupid. I kept thinking "well how will he know that the next argument is not the function to return to?" I felt somewhat like a friend of mine (a very smart friend) who picked up a bag of potato chips at the market (which happened to be upside down), and said, "Woah! They printed this bag lable the wrong way round!" She immediately asked me not to tell anyone about it. Yeah, I felt that dumb.
I'm diggin' working with this AjaxCFC. Don't really know what my mental block about using was before. It's really not that hard. I guess I just didn't try hard enough. My thanks to those folks who pushed me to just take another look at the examples. :)
Chris
Dave Shuck wrote:I have been known to take the approach of building an array in _javascript_, then passing it to the CFC. Just remember that the JS array will be 0-based and the argument array will be 1-based in the CFC.
~Dave
On 7/23/06, Adrian J. Moreno < [EMAIL PROTECTED]> wrote:Chris,
you may have found out already, but in case not, here's how:
DWREngine._execute(_cfscriptLocation, null, 'cfFunctionName', arg1,
arg2, arg3, ...., argN, jsResultFunctionName);
-- Adrian
Christopher Jordan wrote:
> Howdy folks,
>
> I'm playing around with AjaxCFC and I've got some simple calls working
> just fine. Now I'm wondering how to pass multiple arguments to the
> DWREngine._execute command. The documentation says that you can pass one
> or more, but doesn't say how to do it.
>
> I'm going to search the net for some examples or something, but thought
> I'd shoot the question at the group and see what y'all know.
>
> Thanks,
> Chris
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.HostMySite.com
www.teksystems.com/
--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz_______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.HostMySite.com
www.teksystems.com/
--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz
_______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
