I was the Google Codeing Basics (http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideCodingBasicsOverlay.html#example-collections) and thought: hey this could be way faster and easier to use than pharsing my JSON object by hand.
So I played with the example and noticed that it worked fine when the JsArray was defined in the HTML file but I couldn't find a solution to pass a String or Url into the function and it returns me an Overlay Type.
So what I want to do is:
I have this function
private native Customer getFirstCustomer(/*TYPE (preferd String)*/ name) /*-{
return (CASTVALUE TO ???) name;
}-*/;
To which I pass
{"FirstName": "Jimmy"}
as String, and It returns me a Java Object like this:
import com.google.gwt.core.client.JavaScriptObject;
class Customer extends JavaScriptObject {
protected Customer() { }
public final native String getFirstName() /*-{ return this.FirstName; }-*/;
}
Is this possible?
Best regards, Stefan