I've read that tutorial. It rather deals with getting data cross-site. My 
question is how do I get my hands on a Javascript-Object defined on the 
website from inside GWT? Once I have that object I can do the rest myself.

On Friday, June 22, 2012 4:25:19 PM UTC+2, Dimitrijević Ivan wrote:
>
> 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/-/BmqIavg1ACoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to