This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to delete items from the cart through jsf  RSS feed

 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • 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.
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Pradeep Katipamula
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!