Here is some of my code:
public abstract class Message extends JavaScriptObject implements
Serializable { // does it need to be serializable?
protected Message() {}
public final native String getType() /*-{ return this.type; }-*/;
public final native Long getTimeLeft() /*-{ return this.timeleft; }-
*/;
}
public static native Message parseJson(String jsonStr) /*-{
return eval(jsonStr);
}-*/;
String myString = "{ \"type\" : \"complete\", \"timeleft\" : -5000 }";
Message message = parseJson(myString);
Window.alert("type: " + message.getType());
During the parseJson call, I get kicked into MethodDispatch.class when
an exception is caught:
} catch (InvocationTargetException e) {
// If we get here, it means an exception is being thrown from
// Java back into JavaScript
wrapException(returnValue, e.getTargetException());
return true;
}
I have read the docs numerous times, and can't figure out what I am
doing wrong. Can anyone help me? Thanks in advance.
Glenn
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.