• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem with a shopping cart application using Stripes

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to implement a simple shopping cart for an e-commerce site I'm building for my wife using Stripes (great framework, by the way), and everything is working fine so far, except for one thing: I can't update the quantity of a particular item once it's been added to the shopping cart.

I can hit the "Add to cart" link again and it will update the quantity, but I also want to be able to type in the exact quantity directly in the quantity field.

This is my shopping cart Action Bean:



and this is my shopping cart JSP:



The form is populated by iterating thru the items in the cart. I have no problem removing a single item from the cart, but I have no idea how to reference a particular item in the cart (which I suppose is mandatory in order to be able to update said item). Anyone know how to achieve that?

By the way, I'm using a ShoppingCart class that implements a singleton pattern, so the shopping cart can be accessed from any action bean. I added this class as an extension to Stripes.

Thanks in advance!
 
Everybody's invited. Even this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic