Problem using exported classes

28 views
Skip to first unread message

V S

unread,
Apr 17, 2014, 6:10:34 PM4/17/14
to gwtex...@googlegroups.com
Hi everybody,

I just started using gwt-exporter, everything looks pretty straightforward and project has good documentation.
However I can't use exported classes: get exception  "TypeError: Cannot read property 'JsState2' of undefined"

When I open dev tools console in Chrome I see:

test.JsState2
function (){ try { return __gwt_makeJavaInvoke(3)(null, 65706, jsFunction, this, arguments); } catch (e) { throw e; } }

But when I create new instance there is and undefined exception:
var t = new test.JsState2();
undefined


Here is my class and entry point. Entry point function is called and everything seem to be fine except can't use exported classes.
Any help is appreciated,
Thank you

-Victor


package js.jstest.client;

import org.timepedia.exporter.client.Export;
import org.timepedia.exporter.client.ExportPackage;
import org.timepedia.exporter.client.Exportable;

import com.riverbed.arx.web.client.WorkState;

@Export
@ExportPackage("test")
public class JsState2 implements Exportable {
private String name2;
public JsState2() {}

public void setName(String name) { name2 = name; }
public String getName() { return name2; }
}




public class UiConsole_export implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
   ((Exporter) GWT.create(JsState2.class)).export();
   onLoadImpl();
 }
 private native void onLoadImpl() /*-{
   if ($wnd.jsOnLoad && typeof $wnd.jsOnLoad == 'function') $wnd.jsOnLoad();
 }-*/;
}


V S

unread,
Apr 17, 2014, 6:26:39 PM4/17/14
to gwtex...@googlegroups.com
Newer mind - found my problem,
I inherited from another project and "onModuleLoad()" from that project was run messing up the script.

-Victor
Reply all
Reply to author
Forward
0 new messages