Use the record ID and not the product name in the dynamic var names

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com
----- Original Message -----
From: "Ezine" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, March 20, 2003 10:13 PM
Subject: Another Challenging question


> Ok..   lets say that I have a HTML form with field names from the
database..
>
>
> Like..      ShoppingItem_ItemCode
>
> Or a better example..   :   'ShoppingItem_' & database.itemcode
>
> so..    as people add items to their shopping cart..   this list gets
> longer..
> <input type="text" name="ShoppingItem_Gyro" value="1">
> <input type="text" name="ShoppingItem_GarbageCan" value="3">
>
> This works all good and well in the recalculate quantity processor by
> getting the second element in the list with delimeter, _ to know what
> product is in the cart and evaluating the full variable to know the new
> quantity..      and using the string 'ShoppingItem_' to distinguish a
field
> containing the items quantity  in the fieldnames variable(skip all of the
> rest).
>
> The problem occurs when someone makes a item with a '-' in the product
> code..
>
> Ex:  someone makes a product with the code; goober-pokerman
> The form field looks like this;
> <input type="text" name="ShoppingItem_goober-pokerman">
>
> But when the processor goes to evaluate the form field..  for the
quantity..
> it looks like this,  (evaluate(field)) which translates to
> (evaluate(ShoppingItem_goober-pokerman))..   and Coldfusion treats it as a
> math equation..
> (ShoppingItem_goober - pokerman) = Error:  ShoppingItem_goober(missing
> '-pokerman') is undefined.   I tried using the DE function and it returns
> the fieldname instead of the value of the fieldname
>
> Any Ideas on how to get around this Dynamic Evaluation quandary? I'm
looking
> for the value of the fieldname..
>
> It is stored two layers deep here...
>
> First..  the field name is stored in a variable(currentitem)..
> then evaluate(currentitem)= Item quantity in cart.
> This works unless the field name contains a '-'.     If it does..  the
> evaluate statement treats it as a math equation and can't find the value
of
> only part of the variable name.
>
> I'm thinking parhaps something like <cfset
> currentvalue=shoppingcartitem_"#currentitem#" or something like that..
> parhaps..
> Any Ideas?
>
>
> -Zine
>
> -----Original Message-----
> From: Joe Eugene [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 21, 2003 12:15 AM
> To: CF-Talk
> Subject: RE: CFMX crashes with high load on cfwddx
>
>
> > Found I can bring down our MX server where cfwddx is used.
>
> This is a known problem, i am not sure if MM is doing anything about it.
> Some MM folks here might be able to answer the status on the cfwddx issue.
>
> Joe Eugene
>
>
> > -----Original Message-----
> > From: Buckland, Ramon [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 20, 2003 8:31 PM
> > To: CF-Talk
> > Subject: CFMX crashes with high load on cfwddx
> >
> >
> > Hi,
> >
> > Found I can bring down our MX server where cfwddx is used.
> >
> > In a nut shell,
> > obtain wddx string and convert it.
> >
> >      <cfwddx action="WDDX2CFML" input="#wddxPacket#" output="st_RS">
> >
> > We use WDDX all over the site as our data layer
> > by retreiving through cfhttp.
> >
> > I tested the cfhttp connections but it all came down to this example.
> > (no cfhttp at all)
> >
> > -------------------------------------
> > <cfset wddxPacket = "<wddxPacket
> > version='1.0'><header/><data><struct><var
> > name='STATUS'><string>1</string></var><var
> > name='RETURNCODE'><string>no_db</string></var></struct></data></wd
> > dxPacket>">
> > <cfwddx action="WDDX2CFML" input="#wddxPacket#" output="st_RS">
> >
> > -------------------------------------
> > Put that in a cfm file and ...
> >
> > Stress testing pages by holding down ,CTRL-R in a browser (IE)
> > the server stops resonding.
> >
> > + From a fresh restart it takes about 5 minutes to bring the server down
> > + From a page with many wddx conversions, I am able to bring the server
> > down in about 5 seconds.
> >
> > * WARNING * This crashes my Dev MX Server on IIS
> > PIII 1.4Ghz , 1.3G RAM
> > IIS5 Win2k All latest patches from MS as of 10 hrs ago.
> > MX Updater 3
> >
> > Please tell me I can fix this with config changes :-)
> >
> > Symptoms of the crash are:
> >     MX stops responding, IIS keeps purring
> >   Restart MX a few times and eventually, IIS stops as well
> >     (I even had inetinfo hang and not die until I restarted IIS
> > Admin Service)
> >
> > suggestions ?
> >
> >
> >
> > - NOTICE -
> >
> > This message may contain confidential, proprietary or legally privileged
> > information and is intended only for the use of the addressee named
above.
> > No confidentiality or privilege is waived or lost by any
mistransmission.
> > If you are not the intended recipient of this message you are hereby
> > notified that you must not use, disseminate, copy it in any form or take
> > any action in reliance on it.  If you have received this message in
error
> > please delete it and any copies of it and notify CREDIT SUISSE
> > ASSET MANAGEMENT
> > immediately.
> >
> > Any views expressed in this message are those of the individual sender,
> > except where the message specifically states otherwise and the sender is
> > authorized to state them to be the views of CREDIT SUISSE ASSET
> > MANAGEMENT.
> >
> > CREDIT SUISSE GROUP, CREDIT SUISSE FIRST BOSTON, and each legal entity
in
> > the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT
business
> > units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor
> > all e-mail
> > communications through its networks.
> >
> >
> >
> >
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to