Ah, never mind! Silly me!
-- I just needed to NOT use the $wnd.google.setOnLoadCallback here. Since it's already loaded, I can safely call the rest of the code directly.
On Saturday, April 11, 2015 at 12:29:14 AM UTC+5:30, Tushar Bhasme wrote:
On Saturday, April 11, 2015 at 12:29:14 AM UTC+5:30, Tushar Bhasme wrote:
I am trying to use Google Feed api (https://developers.google.com/feed/v1/devguide#hiworld ) in my project. To load the library, i added to my html file as per dev guide:<script type="text/javascript" src="https://www.google.com/jsapi "></script><script type="text/javascript">google.load("feeds", "1");</script>This loads the library without issue. For loading the feed, I used JSNI:public native void loadFeed(String feedUrl) /*-{var that = this;$wnd.google.setOnLoadCallback(function() { var feed = new $wnd.google.feeds.Feed(feedUrl); feed.load(function(result) {if (!result.error) {var container = $doc.getElementById("feed");for (var i = 0; i < result.feed.entries.length; i++) {var entry = result.feed.entries[i];var div = $doc.createElement("div");div.appendChild($doc.createTextNode(entry.title)); that.@com.vernuso.trust.client.widget.feed. RssFeedPanel:: addFeedToContainer(Lcom/ google/gwt/dom/client/ DivElement;)(div); // to append the code in my component in java }}});});}-*/;and call this method from my presenter by passing the feed url. There is no error but the code inside the function() passed to setOnLoadCallback never gets called.Where did I miss?
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment