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を実際に使用するように<button>変更するか、をボタンに変更@UiFieldします(そして呼び出しをドロップしwrap(...)ます)。

于 2012-11-25T16:02:01.510 に答える