How does the GWT 2.1 editor environment support primitive types?

I am trying to associate a field of primitive type "int" with an editor. My editor extends ValueBox<Integer> , since generics in Java can only use object types.

When I compile my application, I get the following error:

00: 00: 18,915 [ERROR] An unexpected int was found during the evauating path "cadastralDivisionCode" using the getter expression ""

Changing the getter and installer to use an Integer object does the trick. Can a primitive type be used in the GWT 2.1 editor?

+7
java editor gwt gwt2
source share
2 answers

You need to wait 2.1.1 for primitive types. There is an open bug tracking this.

+4
source share

We did not look at the internals of GWT, but most likely it is impossible to do this because primitive values ​​are not processed by reference and cannot be placed in collections.

The only way is to use equivalent object types, for example. Integer for int .

+4
source share

All Articles