I’m trying to wrap a ButtonElement into a Button:
@UiField ButtonElement myButton;
Button theButton = Button.wrap(myButton);
However, I am getting this error:
@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
This means that while you have a
ButtonElementin your java code, the uibinder tag with the name “myButton” is actually aButtonwidget, not aButtonElementelt.Change the uibinder to actually use a
<button>, or change the@UiFieldto be a Button (and drop thewrap(...)call).