Thursday, March 28, 2013

"Complex" JSON Overlay

Hi all,

I try to use overlay type on this kind of JSON:

{"records": [{"names": {"John": ["50", "H", "US"], "Jack": ["40", "H", "EN"]}, "style": "TR"}]}

So, to get the value of "style", I do that and it works:

public final native String getStyle()
/*-{
return this.records[0].style;
}-*/;
Now I want to get the values of "names". I do that and what I get is always null.

public final native String getNames(final int i)
/*-{
return this.records[0].names[i];
}-*/;

 
Why? Is it the good way to get the names and their properties? (like ["50", "H", "US"])

Thank you in advance :)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment