Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSNI - invoking native method from another native method

 
Senthil Jayakumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am newbie to JSNI + GWT.

I have two native methods and the requirement is to invoke one of the native method from another native method, I am not sure if this is possible, if so how should I able to call the another native method from the native method.

Below is the code snippet.

Thanks in advance.

public static native void testFunction() /*-(
var $ = $wnd.$;
$(document).ready(function(){
function testMyFunction(){
alert("hello world!");
}
});
}-*/;

public static native void commonjQuery() /*-{
var $ = $wnd.$;

$(document).ready(function(){

testFunction(); --> Trying to invoke testFunction() from here, but it doesn't seem to work, please help in suggesting how this can be achieved.

var mainWidth;
var mainHeight;
var headerHeight;

...
...
}
});
}-*/;


Thanks,
Senthil Jayakumar
native_method.JPG
[Thumbnail for native_method.JPG]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic