It's easy for the 1st question: addSymbolButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { test(); } });
private native void test() /*-{ $wnd.testFunction(); }-*/; where testFunction is the existing javascript function. I still don't know the answer for the 2nd question which is: how to call an existing javascript function when GWT finishes its job when a page is loaded? On Thu, Mar 17, 2011 at 6:36 AM, Thai <tdan...@gmail.com> wrote: > Hi All, > > addSymbolButton.addClickHandler(new ClickHandler() { > @Override > public void onClick(ClickEvent event) { > // How to call a javascript function, e.g. buttonClick(), > here? > } > }); > > and how to call an existing javascript function after GWT finishes > everything on a page? Let me explain it in another way: for example my > page is like this: > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ > TR/html4/strict.dtd"> > <html> > <head> > <script type="text/javascript" src="MName/MName.nocache.js"></ > script> > </head> > <body></body> > </html> > > I think in MName.nocache.js GWT will catch the onLoad event of the > body or the DOM ready event. What I want is to execute a javascript > function (without arguments) after GWT finishes its job in the body's > onLoad event handler or DOM-ready event handler. > > Thank you. > > -- > 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-toolkit@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. > > -- 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-toolkit@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.