• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to delete items from the cart through jsf

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am working on a project where we are storing user selection in cart if the usre wants to delete the selected item. To achieve please assit me
how to achieve this by using an appropriate jsf componenet . I tried using <h:selectmanycheckbox > but couldnt achieve this.
If user see remove image and then user should be able to dlete that respective selected item so how to achieve this any suggestion will be welcome.

Thanks in advance.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My cart uses a dataTable to display the items in the cart. A SelectOneCheckbox control for each item provides a way to indicate what item(s) to delete from the cart. You can also just put a "Delete" commandButton or commandLink in the item display row.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jasmine,

Can you be more precise about the content in the shopping cart. How is it displayed?
Something about your design and UI.

Since nothing much is available lets assume that you display the content of the cart as images.
So for each item you can add a delete link/button.

for a button on UI here would be the code.


The value of id in the 'someDeleteBean' will be automatically populated with the itemcode.
So, in the delete method just take the id value and delete the respective item from the session container.

Hope this helps

Pradeep
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Thanks to all and pradeep , well you have undertsood correctly that is what I want to achieve,. I will implement as in my UI I need to delete services on the basis of their serviveid . User select services and delete selected selected services on the basis of service id so i will implement as you advise me.

I will update you for the same.

Thanks to all once again for helping me out.
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic