Stephen,
You're most likely going to need to use the $wnd or $doc variable
within your JSNI code as the Garmin JS is not loaded into the same
area as GWT code (
http://code.google.com/webtoolkit/doc/1.6/
DevGuideCodingBasics.html#DevGuideJavaScriptNativeInterface)
i.e. var display = new $wnd.Garmin.DeviceDisplay("garminDisplay",
{........
//Adam
On 21 Nov, 20:25, Stephen Walsh <
stephenwalsh....@gmail.com> wrote:
> I am trying to use the above api to implement some JSNI code in my
> onModuleLoad method. I am having the darnedest time trying to get it to
> recognize that I have the extra javascript files available. The JS debugger
> in Chrome keeps saying that Garmin is undefined (see below). Here's the
> dilemma: when I create my JSNI it gets compiled in the main JS code and
> evidently the Garmin JS code is out of the scope of where the call happens
> in the compiled JS. I'm somewhat new to GWT, and I'm not sure if I'm doing
> something incorrectly or not. Here's what I've got in my project:
>
> src
> ---public
> ------communicator-api
> ---------miscellaneous garmin folders in the original structure
> ---garmin_project.gwt.xml
>
> com.stephenlwalsh.garmin_project.client
> ---garmin_project.java
>
> Contents of garmin_project.gwt.xml The script src tags are doing a fine job
> of pulling in the js needed and the entire communicator-api folder on
> compile.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "
http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source...
> ">
> <module rename-to='garmin_favorites_sync'>
> <!-- Inherit the core Web Toolkit stuff. -->
> <inherits name='com.google.gwt.user.User'/>
>
> <!-- Inherit the default GWT style sheet. You can change -->
> <!-- the theme of your GWT application by uncommenting -->
> <!-- any one of the following lines. -->
> <inherits name='com.google.gwt.user.theme.standard.Standard'/>
> <!-- <inherits name='
com.google.gwt.user.theme.chrome.Chrome'/> -->
> <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
>
> <!-- Other module inherits -->
> <script src="
http://www.google.com/uds/api?file=uds.js&v=1.0&gwt=1