• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • 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!
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic