0

我正在尝试将 ButtonElement 包装到 Button 中:

@UiField ButtonElement myButton;

Button theButton = Button.wrap(myButton);

但是,我收到此错误:

@UiField myButton, template field and owner field types don't match: com.google.gwt.dom.client.ButtonElement is not assignable to com.google.gwt.user.client.ui.Button
4

1 回答 1

2

这意味着虽然您ButtonElement的 java 代码中有一个,但名称为“myButton”的 uibinder 标记实际上是一个Button小部件,而不是一个ButtonElementelt。

将 uibinder 更改为实际使用 a <button>,或将 更改@UiField为 Button (并放弃wrap(...)呼叫)。

于 2012-11-25T16:02:01.510 回答