You should use JSNI interface for that.
Check this
out https://developers.google.com/web-toolkit/doc/latest/tutorial/JSON#client
On Friday, June 22, 2012 1:34:32 PM UTC+2, Carsten wrote:
>
> Thanks. Reading the Dictionary JavaDoc I thought this is the solution.
>
> The problem is my JSON data string has an array with objects inside:
>
> var CurrentTheme = {
> highlightColor: "#FFFFFF",
> shadowColor: "#808080",
> data: [{}, {}, {}]
> };
>
>
> calling dictionary.get("highlightColor") works great but when I want to
> get the string that makes up my data array it returns: [object
> Object],[object Object],[object Object], ... etc ... ]
>
> I guess I could work around this by escaping the data-array and thus turn
> it into a string. Or is there a better solution?
>
> I also need to add a module <inherits name="com.google.gwt.i18n.I18N"/> I
> otherwise do not use if I want to use Dictionary.
>
> I am wondering if there is perhaps some other way then Dictionary to
> easily get a simple JSON-string into GWT without importing another module,
> writing JSNI or escaping the JSON string?
>
>
> Thanks,
> Carsten
>
> On Friday, June 22, 2012 4:31:52 AM UTC+2, Joseph Lust wrote:
>>
>> One easy way would be to use the
>> Dictionary<http://google-web-toolkit.googlecode.com/svn/javadoc/1.4/com/google/gwt/i18n/client/Dictionary.html>object
>> in GWT if you just have and associative array of key/value pairs.
>> See the example code in the JavaDoc.
>>
>> Sincerely,
>> Joseph
>>
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/N2yL9twrcRQJ.
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.