On Apr 14, 10:44 pm, randasin wrote:
> Trying to click a button, I wrote a JSNI call like this
>
> public native void clickAddButton() /*-{
> $doc.getElementById("addButton").click();
>
> }-*/;
>
> It works on IE7, but on Firefox, I get an error
> "$doc.getElementById(cJc).click() is not a function"
>
> I feel like it's a very simple mistake on my part that I just can't
> see. Can somebody help me out please?
>
> Actually it would be great if somebody could show me an example of how
> to click a button (button declared in HTML, not GWT button) without
> using JSNI at all.
ButtonElement.as(Document.get().getElementById("addButton")).click();
(if you have an and not a , then use InputElement
instead of ButtonElement)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.