Java 将ButtonElement包裹到Button
我正在尝试将ButtonElement包装到按钮中:Java 将ButtonElement包裹到Button,java,gwt,Java,Gwt,我正在尝试将ButtonElement包装到按钮中: @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
@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更改为实际使用
,或将@UiField
更改为按钮(并放弃换行(…)
调用)