Hi,
I am trying to make a jsni method call and using the return value, I want to
invoke another method in the calling html.
Using the getData() method in the html, I am calling getId() whose
implementation is in the gwt module. The getId returns an Id which is used
to make another function call from the parent html.
*JS in html*
var id;
function getData(){
getId();
if(typeof(id)!== 'undefined') {
fetchData(id);
}
}
function fetchData(id){
// Implementation here
}
*JSNI code*
public native void publishGetId() /*-{
var jsId = [email protected]::instanceId;
$wnd.getId = function() {
$wnd.id = jsId;
};
}-*/;
the instanceId is an int and non static and on the pageload is not
initialised, but is updated at a later stage.
The method is publishGetId is called on the onModuleLoad.
*The strange behavior that i am facing is that even though the instanceId is
getting updated the "jsId" is not reflecting the same.It shows undefined all
the time.*
The getData() is called from the parent html after gwt module is loaded and
after the instanceId is updated.
Any help would be greatly appreciated.
Thanks
Sudeep
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---