我正在尝试将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
这意味着
,虽然你的java代码中有ButtonElement
,但名为"myButton"的uibinder标签实际上是一个Button
小部件,而不是一个ButtonElement
的elt。
将 uibinder 更改为实际使用 <button>
,或将@UiField
更改为按钮(并放弃wrap(...)
调用)。