gpt4 book ai didi

gwt - 编辑器和整数字段的多个问题

转载 作者:行者123 更新时间:2023-12-04 04:41:37 25 4
gpt4 key购买 nike

类型 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 的类型从 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 可编辑,如果可能的话,不要大惊小怪。

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

最佳答案

IntegerBox 也许?

如果您希望它只读,请使用 NumberLabel<Integer> (在 Java 中,在 UiBinder XML 中保留 NumberLabel)

关于gwt - 编辑器和整数字段的多个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18787340/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com