datni / gwt-pectin

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

Formatted field doesn't update at blur #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. public FormattedFieldModel<Double> fldPrice = 
formattedFieldOfType(Double.class).using(new 
MoneyAmountFormat()).boundTo(bindings, "price"); 
2. Edit the field with 2.5
3. When bluring the value remains 2.2 instead of the formatted value
4. To work around this, do the same but also add on the bound field a blur 
handler that sets the format again on the FormattedField (forcing field format).

What is the expected output? What do you see instead?

The expected output is the formatted value when bluring the field, I see 
instead the raw data type value

What version of the product are you using? On what operating system?

GWT 2.0.3 / Pectin 0.7

Please provide any additional information below.

http://groups.google.com/group/gwt-pectin-discuss/browse_thread/thread/b86860a56
bafc28e

Original issue reported on code.google.com by dorel.va...@gmail.com on 26 Jul 2010 at 8:26

GoogleCodeExporter commented 8 years ago
Sorry for the 2.5 / 2.2 :-( pick one of them :-)

Original comment by dorel.va...@gmail.com on 26 Jul 2010 at 8:27

GoogleCodeExporter commented 8 years ago
I've updated this so formatted field models now have a `sanitiseText()` method 
that when invoked runs the text value through the formatter.  The method 
doesn't affect the real value and will leave invalid text values unchanged.

I've also updated the bindings so you can sanitise the value onBlur.  I.e. 
`binder.bind(formattedField).to(widget).sanitiseTextOnBlur();`. 

This is now in 0.8-SNAPSHOT.

Original comment by andrew.pietsch on 27 Jul 2010 at 5:20

GoogleCodeExporter commented 8 years ago

Original comment by andrew.pietsch on 30 Jul 2010 at 8:13