File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes GWT and the fly likes JSNI - invoking native method from another native method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "JSNI - invoking native method from another native method" Watch "JSNI - invoking native method from another native method" New topic
Author

JSNI - invoking native method from another native method

Senthil Jayakumar
Greenhorn

Joined: Apr 15, 2012
Posts: 1
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


[Thumbnail for native_method.JPG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSNI - invoking native method from another native method
 
Similar Threads
read a property file to set variables using javascript
Issue compiling a GWT FeedReader Application
Native method using JSNI
Reading properties file in javascript
Get GWT value in Javascript