• 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
Re: WORepetition and Cart Functionality
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WORepetition and Cart Functionality


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

It's in the yellow book?
Well, so it is!
I must pay more attention to the stuff that I read.

I think that the butler did it in the end.

Neil


On 20 Feb 2009, at 01:28, Chuck Hill wrote:

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?


That is a pretty common problem as WO maintains page state on the server. There are several ways of handling this, most based on delaying the action until after takeValues. Chapter 7 of Practical WebObjects covers this problem and how to deal with it.

Chuck

_______________________________________________ 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
References: 
 >WORepetition and Cart Functionality (From: Neil MacLennan <email@hidden>)
 >Re: WORepetition and Cart Functionality (From: Chuck Hill <email@hidden>)

  • Prev by Date: [OT] Webcast tests
  • Next by Date: Re: Peer ECs in updating EO
  • Previous by thread: Re: WORepetition and Cart Functionality
  • Next by thread: WO5.4.3 + Axis1.4 problem on deployment
  • Index(es):
    • Date
    • Thread