Thursday, December 2, 2010

CellTable and multiple editable columns

I am using CellTable with simple pager to show ArrayList<Contact>
contacts. There are multiple columns that are editable mostly using
EditTextCell. I have implemented FieldUpdater for editable columns.
But I do not want to make server side save/update call each time there
is change made to particular editable column.

I would like to collect all the updates, lets say in
ArrayList<Contact> modifiedContacts and send it server side by using
some kind of Save Contacts button.

I am able to do this if I keep only one column editable, but moment I
add multiple columns as editable, I start getting duplicate objects in
my ArrayList<Contact> modifiedContacts since each editable column is
implementing FieldUpdater.

When 2 or more columns of same row are updated, FieldUpdater of each
column is fired, storing duplicate objects in ArrayList<Contact>
modifiedContacts.

I could use Set instead of ArrayList to store unique contact objects
but is there better way to do this ?

Thanks
Mittal

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment