编辑器和整数字段存在多个问题

时间:2013-09-13 13:18:18

标签: gwt

com.google.gwt.user.client.ui.NumberLabel类型可分配给原始IsEditor类型,但需要类型参数化

我有一个具有2个属性的对象:

id:整数
categoryName:String

上述对象的编辑器中的相应字段是:

    @UiField
    TextBox id;

    @UiField
    TextBox catNme;

当我进行调试时,会出现以下消息:

[ERROR] Line 17: Type mismatch: cannot convert from Integer to String

我尝试将id的类型从TextBox更改为NumberLabel(也在ui.xml文件中),如下所示:但现在我收到一条新的错误消息:

[ERROR] [aproj] - The type com.google.gwt.user.client.ui.NumberLabel is assignable to the raw IsEditor type, but a type parameterization is required.

我想做的是让id可编辑,如果可能的话,不用大惊小怪。

有关如何解决此问题的任何建议?

1 个答案:

答案 0 :(得分:3)

IntegerBox也许?

如果您想要它是只读的,请使用NumberLabel<Integer>(在Java中,在UiBinder XML中保留NumberLabel

相关问题