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



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

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

id : 整数
类别名称:字符串

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

    @UiField
    TextBox id;
    @UiField
    TextBox catNme;

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

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

我尝试将 id 的类型从文本框更改为数字标签(也在 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 可编辑,如果可能的话,不要大惊小怪。

关于如何解决这个问题的任何建议?

也许

IntegerBox

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

最新更新