Search the web
Sign In
New User? Sign Up
ajaxcfc · ajaxCFC Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Run a function in a function using ajaxcfc component   Message List  
Reply | Forward Message #1554 of 1584 |
Re: [ajaxcfc] Run a function in a function using ajaxcfc component

Good Morning,

That's exactly what I determined. The way CF handles
variables as a standard cfm file verses a cfc
component is what threw me off. Thanks for your input,
have a great day.


--- Kevin <chornobyl@...> wrote:

> It looks like the function ones() is not returning
> anything.
>
> It needs a variable to return.
>
> Try this:
>
> <cffunction name="ones">
> <cfargument name="num" type="numeric">
> <cfset var result = "">
> <cfswitch expression="#num#">
> <cfcase value="1"><cfset result = "one"></cfcase>
> <cfcase value="2"><cfset result = "two"></cfcase>
> <cfcase value="3"><cfset result = "three"></cfcase>
> <cfcase value="4"><cfset result = "four"></cfcase>
> <cfcase value="5"><cfset result = "five"></cfcase>
> <cfcase value="6"><cfset result = "six"></cfcase>
> <cfcase value="7"><cfset result = "seven"></cfcase>
> <cfcase value="8"><cfset result = "eight"></cfcase>
> <cfcase value="9"><cfset result = "nine"></cfcase>
> </cfswitch>
> <cfreturn result>
> </cffunction>
>
> On Wed, Apr 2, 2008 at 11:21 AM, Keith
> <head_java@...> wrote:
>
> > Good Morning,
> >
> > I located a cfm program to convert numeric to
> words. 1 = one, 2 =
> > two etc. I'm trying to run this as a ajaxcfc
> component but when I do
> > a cfset results = #ones(thisNum)# (ones is a
> function within the
> > ajaxcfc component) javascript chokes on the
> returned value with
> > Object doesn't support this property or method. I
> think running the
> > function in the cfset is the cause. A shorten
> version of the
> > component is listed below:
> >
> > <cfcomponent extends="/AjaxCFC/ajax">
> >
> > <cffunction name="getLiteralDays">
> > <cfargument name="days" required="yes"
> type="numeric">
> > <cfset thisNum = #arguments.days#>
> > <cfset results = "">
> > <cfif len(thisNum) lt 2>
> > <cfset results = #ones(thisNum)#>
> > </cfif>
> > <cfreturn results />
> > </cffunction>
> >
> > <cffunction name="ones">
> > <cfargument name="num" type="numeric">
> > <cfswitch expression="#num#">
> > <cfcase value="1">one</cfcase>
> > <cfcase value="2">two</cfcase>
> > <cfcase value="3">three</cfcase>
> > <cfcase value="4">four</cfcase>
> > <cfcase value="5">five</cfcase>
> > <cfcase value="6">six</cfcase>
> > <cfcase value="7">seven</cfcase>
> > <cfcase value="8">eight</cfcase>
> > <cfcase value="9">nine</cfcase>
> > </cfswitch>
> > </cffunction>
> > </cfcomponent>
> >
> > Not sure how else to do this using ajaxcfc. Any
> suggestion would be
> > great. Thanks.
> >
> >
> >
>




________________________________________________________________________________\
____
You rock. That's why Blockbuster's offering you one month of Blockbuster Total
Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com



Thu Apr 3, 2008 2:01 pm

head_java
Offline Offline
Send Email Send Email

Forward
Message #1554 of 1584 |
Expand Messages Author Sort by Date

Good Morning, I located a cfm program to convert numeric to words. 1 = one, 2 = two etc. I'm trying to run this as a ajaxcfc component but when I do a cfset...
Keith
head_java
Offline Send Email
Apr 2, 2008
3:22 pm

It looks like the function ones() is not returning anything. It needs a variable to return. Try this: <cffunction name="ones"> <cfargument name="num"...
Kevin
lbretail22
Offline Send Email
Apr 3, 2008
3:20 am

Good Morning, That's exactly what I determined. The way CF handles variables as a standard cfm file verses a cfc component is what threw me off. Thanks for...
Keith Henderson
head_java
Offline Send Email
Apr 3, 2008
2:05 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help