You didn't create those variables. You created a string. If you output
caculateTotal, you will see the literal text you wrote, not variables.


On Wed, Feb 22, 2012 at 4:43 PM, Ray Meade <[email protected]> wrote:
>
> By the way, is there a way to grab the variables created by cfsavecontent? 
> When I try to access the variable calculateTotal.totalAmount, I get the "You 
> have attempted to dereference a scalar variable of type class 
> java.lang.String as a structure with members." error message which means I'm 
> trying to use a string as a structure. When I use a cfdump to dump 
> calculateTotal, it just shows me the entire code in one long string like so:
>
> "var totalAmount = 0; var item; var subTotal = 0; for(var i = 0; i < 
> cart.length; i++) { item = cart.getItemAt(i); subTotal = 
> number(item['price']) * item['quantity']; totalAmount += subTotal; 
> cart.editField(i, 'amount', subTotal); } total.text = totalAmount;"
>
> Is it not possible to reference the variables in a cfsavecontent?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350050
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to