How to using Jquery to call GWT binding event
I have a GWT demo project that includes a data table with 3 columns and 5 rows. i used gwt to i开发者_如何学Gomplement:
table.addTableListener( new TableListener(){
public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
demoFunc();
}
});
How can i create a html button and using jquery to call "onCellClicked" event.
<input type="button" id="button1" value="click here"/ >
..
$("#button1").click(function(){
//implement here to call "onCellClicked" event.
});
Have a look at gquery, a jquery port of GWT: http://code.google.com/p/gwtquery/ Haven't tested it beyond GWT 1.5.
Otherwise you'll need to do some JSNI, wrap a javascript function inside JSNI tags and call the javascript either using GWT or using jQuery or whichever way you want.
See the docs: http://code.google.com/webtoolkit/doc/2.2/FAQ_Client.html
精彩评论