سؤال

I am trying to bind a field of the primitive type "int" to 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] Found unexpected type int while evauating path "cadastralDivisionCode" using getter expression ""

Changing the getter and the setter to use an Integer object, does the trick. Is there any way to use a primitive type in the GWT 2.1 editor framework?

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

Haven't looked at GWT internals, but most probably it can't be done, because primitive values are not handled by reference and can not be put into Collections.

The only way around is to use equivalent object types, e.g. Integer for int.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top