• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WORepetition and Cart Functionality
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WORepetition and Cart Functionality


  • Subject: WORepetition and Cart Functionality
  • From: Neil MacLennan <email@hidden>
  • Date: Fri, 20 Feb 2009 00:27:33 +0000

Hi there,

In what I imagine to be a common scenario, I have a WORepetition wrapping products in a shopping cart and displaying them.
A user can alter the quantity of a given product including setting that quantity to zero == delete this product from my cart.
In my component java file, I look out for this zero quantity and send a remove message to my cart to delete that product from the cart.


The problem is that in takeValuesFromRequest, WORepetition throws an NSArray ArrayOutOfBounds Exception because I've removed a product from the cart and (presumably) it keeps iterating through the cart line items as it processes the request and comes up one short by the end.

I'm currently working around it by setting the quantity to zero from the component (rather than removing it) and have added a trimCart() method to my cart to remove products with a zero quantity after the takeValuesFromRequest phase has completed.

This seems like a common thing to want to do, have I gone about it the wrong way initially?

.neilmac

OSX 10.5/WO5.4.2/Eclipse/Wonder
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: WORepetition and Cart Functionality
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: OT: Drew Davidson
  • Next by Date: Re: WO/Wonder and Java 6 as a deployment environment?
  • Previous by thread: WOWODC 09 : call for speakers!
  • Next by thread: Re: WORepetition and Cart Functionality
  • Index(es):
    • Date
    • Thread