1) create a folder named "public" at the same level of your project's *.gwt.xml file
2) In your project's *.gwt.xml file include the required javascripts,
In your case jquery.js and tipsy.js or whatever, like this:
<inherits name="com.google.gwt.user.User" />
...
<script src='jquery.js' />
<script src='tipsy.js' />
3) create a method for invoking tipsy natively:
public static native void tipsy(String id)/*-{
$wnd.$('#'+id).tipsy();
}-*/;
A tip, you can use GWT dom classes for accessing the DOM elements directly and safely.
Good look, tell us about your results!
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/mBJME9gMRS4J.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
--
Sebastian Gurin <sgu...@softpoint.org>
$('#foo').tipsy({gravity: 'n'})
you can present the argument object {gravity: 'n'} using gwt overlay types like this:
public class TipsyConfig extends JavaScriptObject {
public final native String getGravity()/*-{
this.gravity;
}-*/;
public final native void setGravity(String g)/*-{
this["gravity"]=g;
}-*/;
}
public class TipsyUtil {
//tipsy main method
public static native void tipsy(String id, TipsyConfig cfg) /*-{
$wnd.$('#'+id).tipsy(cfg);
}-*/;
//and create the native TipsyConfig in some method:
public static native TipsyConfig createConfig() /*-{
return {};
}-*/;
}
So now in your java client programs you can do all the job 100% in java like this:
TipsyConfig cfg = createConfig();
cfg.setGravity("w");
TipsyUtil.tipsy("div1", cfg);
TipsyUtil.tipsy("div2", cfg2);
etc
hope that helps too
On Wed, 8 Feb 2012 11:21:22 -0800 (PST)
kellizer <kell...@gmail.com> wrote:
> Works a treat - thank you very much!!!!
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/a7aSczHMxSMJ.