Re: Shopping Cart [Solved]
Re: Shopping Cart [Solved]
- Subject: Re: Shopping Cart [Solved]
- From: David Griffith <email@hidden>
- Date: Mon, 01 Mar 2004 13:40:04 +0100
Interesting that there was no response to this at all. Anyway, thought I'd
post a message for anyone else that might be in the same boat at some stage.
For some reason, I could not get this to work at all with a Display Group.
I'm guessing this has something to do with the internal workings of it, or
that I was doing something wrong.
In the end, I created my own simulated Display Group (in other words just an
NSMutableArray of the values which I display in the same way as a Display
Group, and using a form around the whole thing, I can place a quantity form
field in the repetition which is linked to cartItem.cartItemQuantity. This
permits me to get the value for each entry in the Array and update the whole
cart accordingly.
Regards,
Dave.
> Hi all,
>
> I have a shopping cart table and a cart items table.
> The EditShoppingCart component uses a display group to show all the cart
> items.
> Each cart item has a quantity value that I need to update using a form entry
> field.
> This means there could be many entry fields with quantities displayed in
> them, and these can be edited by the user.
> When the user clicks update9 I want it to update other values in each row
> of the displayGroup and save them all back to the database.
>
> Can someone tell me the procedure I should use?
>
> If the Item9 binding of my WORepetition for example is a CartItem, and each
> element in the WORepetition displays by having a binding like
> cartItem.prodName9, then should I bind the cartItem.quantity to the Form
> element for editing the quantity? I think this won9t work but am not sure.
>
> Then, when the update button is clicked, should I step through the display
> group myself, make the changes, and then do an ec.saveChanges?
>
> If so, how do I step through the display group, and how would I identify the
> value of cartItem.quantity in the java code?
>
> I9m sure this is pretty straight forward but I could do with some pointers
> :-)
>
> Regards,
> Dave.
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.