Hi Adam,
Try including the <script> tag referencing the tweetgrid widget in your host
HTML page directly. The reason why this won't work if you insert the
<script> tag through an HTML widget is because GWT application load up in
their own iframes. This means that references to variables that aren't
properly scoped in a third party library (or in your own handwritten
JavaScript code) might not be properly resolved since the window object
would now refer to the <iframe> window rather than the main window.

Placing the <script> tag in your host HTML page should solve this problem.
If you want to interact with the embedded widget from within your GWT code
(through JavaScript Native Interface methods, a.k.a. JSNI), you can do this
by referring to the objects defined on the main window through the $wnd
handle.

You can find more documentation on using JSNI at the link below:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideJavaScriptNativeInterface

Hope that helps,
-Sumit Chandel

On Tue, Jan 27, 2009 at 1:32 PM, adambossy <adambo...@gmail.com> wrote:

>
> It just occurred to me that this pretty obviously won't work, because
> it is calling the <script src="..."></script> widget tag inside of an
> existing <script></script> enclosure. How do I call this aside from
> ripping out the widget internals and rewriting them myself?
>
> Adam
>
>
> On Jan 27, 12:02 pm, adambossy <adambo...@gmail.com> wrote:
> > This seems so simple, that I must be overlooking some obvious GWT
> > characteristic. I would like to embed a TweetGrid from here:
> >  http://tweetgrid.com/searchtips
> >
> > The code is short and simple:
> >   <script src="http://tweetgrid.com/widget/widget.js"; type="text/
> > javascript"></script>
> >
> > I wrap this as an HTML element, and add it to the main panel:
> >   HTML widget = new HTML("<script src="http://tweetgrid.com/widget/
> > widget.js" type="text/javascript"></script>")
> >
> > It seems as though the widget loads, but the callback to populate the
> > widget does not recognize the function it's supposed to call. The
> > exact error is as follows (on a brand-new GWT project, no other
> > complications):
> >
> > jtw_searchfunc is not defined, line 1
> >   search.json?callback=jtw_searchfunc&q=twitter&rpp=20()()
> >
> > How do I properly add this widget so that this does not occur?
> >
> > Thanks,
> > Adam
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to