nishtahir / gwt-pectin

Automatically exported from code.google.com/p/gwt-pectin
0 stars 0 forks source link

bind(ListModel<T>).containing(T).to(HasValue<Boolean>) gives false positives for dirty state #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There's currently a gotcha with using listmodels when used in conjunction
with dirty tracking.  The problem exists because for some collections order
is important and for others it isn't.

For example binding a collection to a group of checkboxes will populate the
list in the order they are clicked.  Thus unchecking and rechecking in the
same order will cause the dirty start to clear, but change the click order
will leave it dirty (very confusing if you're displaying dirty state on the
UI).

Prior to 0.6 BeanProperyListModels ignored order (and naively used
collection.containsAll(checkpointState)) which allowed the above case to
work but failed when a AbstractDynamicList contained the same elements in a
different order.

A solution needs to be found whereby either ordering can be maintained in
the checkbox binding case.  I will likely have to update ListModel to
support set(int index, T value).

Original issue reported on code.google.com by andrew.pietsch on 24 Feb 2010 at 10:53

GoogleCodeExporter commented 8 years ago

Original comment by andrew.pietsch on 26 Feb 2010 at 5:41

GoogleCodeExporter commented 8 years ago

Original comment by andrew.pietsch on 9 May 2010 at 3:52