I think your code seems fine and although I didn't dig through GWTs source 
code I found it totally legal to have null values for empty fields. I mean 
if you assume the object you edit goes (at some time) into the database then 
I think its desirable to store null (= nothing) into the database instead of 
"empty data".

So I do think its not a bug. Its just how the default TextBox editor 
implementation (The 
ValueBoxEditor: 
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/editor/ui/client/adapters/ValueBoxEditor.java)
 handles 
empty data.

And the difference you see between ValueBoxBase<T> and TextBoxBase is 
because ValueBoxBase<T> operates on any data type T and if you do not know 
the type you have to return null in case of an empty String in the wrapped 
input element. Only subclasses of ValueBoxBase<T> can decide if something 
like an "empty T" exists and thats why TextBoxBase converts null back to an 
empty String. An IntegerBox for example cant do that (an empty Integer does 
not exist) and thus it returns null.

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/OeNePO10hssJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to