I'd like to write a wrapper for the javascript library mobiscroll.
I want a stand alone library with all the css and javascript files embedded.
It works fine when the scripts are included in the host page but when I try to inject them, I always get the same error : "jQuery is not defined".
I can't declare my scripts in the gwt.xml because I use xsi linker.
I tried ScriptInjector and more recently JsniBundle from Gquery.
It seems that Jquery is not loaded when the other scripts are injected...
public class GwtMobiscroll implements EntryPoint {
interface JqueryResource extends JsniBundle {
JqueryResource INSTANCE = GWT.create(JqueryResource.class);
@LibrarySource("js/jquery-2.0.3.min.js")
interface MobiscrollJsniResource extends JsniBundle {
MobiscrollJsniResource INSTANCE = GWT.create(MobiscrollJsniResource.class);
@LibrarySource("js/mobiscroll.core.js")
public void mobiscrollCore();
@LibrarySource("js/mobiscroll.datetime.js")
public void mobiscrollDateTime();
@LibrarySource("js/mobiscroll.scroller.js")
public void mobiscrollScroller();
@LibrarySource("js/mobiscroll.scroller.ios7.js")
public void mobiscrollScrollerIos7();
@LibrarySource("js/i18n/mobiscroll.i18n.fr.js")
public void mobiscrollI18nFr();
@LibrarySource("js/i18n/mobiscroll.i18n.de.js")
public void mobiscrollI18nDe();
interface MobiscrollCssResource extends ClientBundle {
MobiscrollCssResource INSTANCE = GWT.create(MobiscrollCssResource.class);
@Source("css/mobiscroll.scroller.css")
CssResource mobiscrollCss();
@Source("css/mobiscroll.scroller.ios7.css")
CssResource mobiscrollIos7Css();
public void onModuleLoad() {
JqueryResource.INSTANCE.jquery();
MobiscrollJsniResource.INSTANCE.mobiscrollCore();
MobiscrollJsniResource.INSTANCE.mobiscrollScroller();
MobiscrollJsniResource.INSTANCE.mobiscrollScrollerIos7();
MobiscrollJsniResource.INSTANCE.mobiscrollDateTime();
MobiscrollJsniResource.INSTANCE.mobiscrollI18nFr();
MobiscrollJsniResource.INSTANCE.mobiscrollI18nDe();
MobiscrollCssResource.INSTANCE.mobiscrollCss().ensureInjected();
MobiscrollCssResource.INSTANCE.mobiscrollIos7Css().ensureInjected();