Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Item in Shopping cart

Status
Not open for further replies.

syidah140484

Programmer
Feb 17, 2005
2
SG
hi all.. i need ur help to check what's wrong with my codes..

e.g.
item 1 Remove btn
item 2 Remove btn
item 3 Remove btn

when i click on the Remove btn of item 2 in shopping cart page.. it removes the item 1.. y???

below are the codes:


public void removeItem(String id){
Enumeration productEnum = getProducts();
while(productEnum.hasMoreElements()){
Product product = (Product)productEnum.nextElement();
products.removeElement(product);



break;

}
}






pls i desperately need someone.. to help me .. :<
 
try adding this code snippet
if product.getId().equals(id)
products.removeElement(product);
after Product product=(Product)productEnum.nextElement();
 
hi.. thanks for replying .. it works.. but there's a problem.. it cannot go to the removeElement() method.. but i tried using Sun 1 prog.. and it can be removed.. but once i used websphere, the problem occur.. y is that so??

p/s: i have to use websphere for the project..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top