Hi all 

Before I take Mark's idea in earnist I have to get over this hurdle

this CFC is (at the moment) just wrapping up struct functions. the idea
works well otherwise.

my GET method works but nothing else does - they all have the same error.
the only thing I can find on this error was fixed with updater 3 but I think
I have that installed - version info: "6,0,0,58500". 

Here's the error

Method selection Exception.  
"An exception occurred during method selection process for Method AddToCart
The cause of this exception was that either there are no methods with the
the specified method name and argument types, or the method AddToCart is
overloaded with arguments types that Coldfusion can't decipher reliablly.
Use javacast function to reduce ambiguity."  

and here's the call and part of the CFC (the GET which works and AddToCart
which errors)

<cfinvoke component="cart2" method="get"
returnvariable="objCart"></cfinvoke>

<cfif isDefined("URL.AddToCart")>
        <cfset sucess = objCart.AddToCart(URL.idProduct, URL.qty)>
</cfif>

<!--------------------------------------------------------------------------
----->
<cfcomponent>
        <cffunction name="AddToCart" access="public" returntype="boolean"
output="false">
                <cfargument name="key" required="true" type="numeric">
                <cfargument name="value" required="true" type="numeric">
                <!---  add the item --->
                <cfset allowoverwrite = TRUE>
                <CFIF NOT isDefined("session.cart") or NOT
isStruct(session.cart)>
                        <cfset session.cart = CreateCart()>
                </CFIF>
                <cfset addItemOK = StructInsert(session.cart, key, value,
allowoverwrite)>
                <cfreturn true>
        </cffunction>
        
        <cffunction name="CreateCart" access="private" output="false"
returntype="struct">
                <cfset cart = structNew()>
                <cfreturn cart>
        </cffunction> 
        
        <cffunction name="get" access="public" output="false"
returntype="struct">
                <CFIF NOT isDefined("session.cart") or NOT
isStruct(session.cart)>
                <!---  check if structure exists already and if not, create
it --->
                        <cfset session.cart = CreateCart()>
                </CFIF>
                <cfreturn session.cart>
        </cffunction> 
<!-------------------------  snip  ------------------------------------->
any ideas on what the error means?

thanx
barry.b





-----Original Message-----
From: Mark M [mailto:[EMAIL PROTECTED]
Sent: Monday, 29 September 2003 10:23 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: Shopping carts: Arrays Vs Structs - what's bes
t?


> that's what I'm working on at the moment although it's just one
> candidate class - the cart itself.
> 
> no one poo-poo'd the struct idea so I got it going with straight
> struct calls.
> 
> but you're right - a CFC is a better idea.

I can just see ya having alot of fun with this one...

I mean - you could have your ShoppingCart.. with a collection of BaseProduct

Classes (either implemented as a ABC, or an Interface).. and have a series
of 
different Products (depends what you are selling) that inherit from the 
BaseProduct... (but that may be more application specific)

But I love doing stuff like this ;o)

Mark

-----------------------------------
[EMAIL PROTECTED]       
ICQ: 3094740
Safe From Bees
[www.safefrombees.com]

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to