Re: WORepetition and Cart Functionality
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