nishtahir / gwt-pectin

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

Fixes to FormattedFieldBindings #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There are currently a number of issues with binding formatted fields to
HasText Widgets.

1. FormattedFieldToHasTextBinding doesn't default to using the format of
the underlying formatted field.
2. FormattedFieldModel and FormattedListFieldModel don't fire change events
for changes to the format.
3. There is no FormattedListFieldToHasTextBinding

The general rules should be: 
1. The bindings should use the underlying field format if the user doesn't
specify one explicitly.  

2. The bindings should track changes to the field format and udpate the
target as it changes unless the user has explicitly specified a format.

Original issue reported on code.google.com by andrew.pietsch on 22 May 2010 at 1:49

GoogleCodeExporter commented 8 years ago
Added FormattedListFieldToHasTextBinding.
Updated FormattedFieldToHasTextBinding to use the field format by default.

Todo:
Need to update the FormattedFieldModel and FormattedListFieldModel to fire 
events
when their format changes.
Need to figure out a nice mechanism to convert the FormattedListFieldModel's 
Format
to a ListDisplayFormat in the binding.  Currently it joins them using commas 
which
isn't i18n complient.  It can be configured using
CollectionToStringFormat.DEFAULT_INSTANCE.setJoinString(..) but that's not
particularly nice. 

Original comment by andrew.pietsch on 22 May 2010 at 2:08

GoogleCodeExporter commented 8 years ago
Should also support binding to external ValueModel<Format<T>> so you can 
dynamically
change the format using an external value model.

formattedFieldOfType(T.class).using(ValueModel<Format<T>>).create()

Need to sensibly handle the case where the format is null.  Probably shouldn't 
barf
and will need to default to a "toString" format.

Original comment by andrew.pietsch on 22 May 2010 at 7:03

GoogleCodeExporter commented 8 years ago
Fixed in 0.8

Original comment by andrew.pietsch on 9 Jun 2010 at 2:35