• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

A better way to implement this?

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I use GWT to implement "Manage Shopping Cart" case.
To display cart's contents, I use FlexTable.
--------------
Item name | delete link
--------------
In order to delete an item, I send item's name along with the current
row of the table to the RPC service.
The service deletes the item and returns row's value back to the client.
Then I have this call:
contentsFlexTable.removeRow(row);
The problem with this approach is :
Suppose I have two rows in the table, row #1 and row #2
And suppose I deleted row #1 first, this works.
The current row value for row #2 is "1"
So, clicking on delete link of row #2 will remove the item from datasouce,
but this doesn't remove the row from FlexTable.
How to over come this problem?
Do you suggest a better approach?
Assume I don't pass row's value to the service, how would I know which
row to remove upon clicking on delete?
Thanks in advance.
 
No, tomorrow we rule the world! With this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!