Link to home
Start Free TrialLog in
Avatar of ManojKumar
ManojKumar

asked on

how to do these?

hi
I'm working on a shopping cart and i'm facing the following problem.could anybody help.
i have a shop cart which shows some lists of products in a table .at the beginning of each row I have included a checkbox which the purchaser can click to indicate if he wants to delete it from the shopcart.how do i handle
A
1.if user clicks one checkbox and then presses a button  to delete.
 2.if the user clicks on more than one rows of products and clicks the delete button
B.After deletion the remaining items in the shopcart should be shown.

I'm working in servlets.the shopcart fethches data from a temporary database table which is updated on every addition/deletion.
could these things be done without major hassles through servletsand jdbc
ASKER CERTIFIED SOLUTION
Avatar of superschlonz
superschlonz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of superschlonz
superschlonz

If you use this session variables you won't get some zombie items in the
database when the customer didn't order, because the session gets a
timeout and the items in the session will be discarded.
what you can do is just keep all the product details in one vector (probaly you can put it in some bean so that vector of productbean)
along with product id.
In the page give the check box name the same (ex : chk)& value as the product id (ex : productBean.getProductId()).
when that page is submited with some check boxes checked for deletion then u can get all the product ids to deleted
(tho request.getParameterValue())
now u can loop tho that & u can just remove that from the vactor in session.
finally update all the values in session to data base..



No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


--  Points to superschlonz


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.