Button.wrap throwing exception

25 views
Skip to first unread message

Deepak Singh

unread,
Jun 13, 2011, 3:07:23 PM6/13/11
to google-we...@googlegroups.com
Hi,

I am using GWT 2.3

I have an existing <input type="button"> element in my hosted html file. When i wrap it like Button btn = Button.wrap(DOM.getElementById('id'));
Then i get following exception


java.lang.AssertionError: null
    at com.google.gwt.dom.client.ButtonElement$.as(ButtonElement.java:33)
    at com.google.gwt.user.client.ui.Button.<init>(Button.java:135)
    at com.google.gwt.user.client.ui.Button.wrap(Button.java:57)
    at com.faregugly.client.Faregugly.createButtonTab(Faregugly.java:60)

Any solution for this pls?

Thanks
Deepak

Thomas Broyer

unread,
Jun 13, 2011, 6:48:24 PM6/13/11
to google-we...@googlegroups.com
As the javadoc says, he Button widget expects a <button>, not an <input type=button>. There's no widget in GWT expecting using <input type=button>, so there's no (easy) workaround, sorry…
Reply all
Reply to author
Forward
0 new messages