I don't know if this is the best way, but I got it to work by making my own 
implementation of  jsArray.

I changed the generic definition from 

public class JsArray<T extends JavaScriptObject> extends JavaScriptObject {


to 

public class JsArray<T> extends JavaScriptObject

which worked with my jsinterop interface.

the problem I see is that although the documentation says an interface 
market JsType will be treated as a JavaScriptObject when casting, that does 
not help for using it in place of a generic.

I don't know what will blow up from this, but it seems to work for me.  If 
there is a better way to do this, I am all ears :)

Thanks,
Eric

On Friday, March 4, 2016 at 9:36:44 AM UTC-5, Ümit Seren wrote:
>
> AFAIK you can't serialize an array directly. You have to put it into a 
> wrapper object. 
>
> On Fri, Mar 4, 2016 at 2:18 PM Eric Nissan <eric....@gmail.com 
> <javascript:>> wrote:
>
>> I tried that also, but
>>
>> Data[] thing = JsonUtils.safeEval(response.getText()).cast();
>>
>> does not compile as Data[] is not a JavaScriptObject
>>
>>
>>
>>
>> On Friday, March 4, 2016 at 2:02:34 AM UTC-5, Ümit Seren wrote:
>>
>>> I think you you have to use a normal array: Data[] 
>>>
>>> Eric Nissan <eric....@gmail.com> schrieb am Fr., 4. März 2016, 04:35:
>>>
>> Thanks a ton!  that worked.
>>>> followup, how do I set a List<Data>?
>>>> I tried to use JsArray but that requires a JavaScriptObject, which Data 
>>>> is not.
>>>>
>>>> Thanks,
>>>> Eric
>>>>
>>>> On Wednesday, March 2, 2016 at 9:36:43 AM UTC-5, Ümit Seren wrote:
>>>>>
>>>>> This works: 
>>>>>
>>>>> {'somecollection':['String1','String2'],'somestring':'text'}
>>>>>
>>>>> @JsType(isNative = true,namespace = JsPackage.GLOBAL,name="Object")public 
>>>>> interface Data {
>>>>>     @JsProperty
>>>>>     String[] getSomecollection();
>>>>>     @JsProperty
>>>>>     String getSomestring();
>>>>> }
>>>>>
>>>>> Data data = JsonUtils.safeEval(json).cast();
>>>>>
>>>>> On Tuesday, March 1, 2016 at 9:03:03 PM UTC+1, Eric Nissan wrote:
>>>>>
>>>>> sorry if this has been answered, I just started using jsinterop in gwt 
>>>>>> 2.8.  What is the recommended way populate data into a jsinterop 
>>>>>> javascript 
>>>>>> object from my server.  Assuming I have Json, do we still use 
>>>>>> OverlayTypes? 
>>>>>>  or is there a better way to do it?
>>>>>>
>>>>>> Always appreciative,
>>>>>> Eric
>>>>>>
>>>>> ​
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "GWT Users" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/google-web-toolkit/nmBAOX4vcSo/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> google-web-toolkit+unsubscr...@googlegroups.com.
>>>>
>>> To post to this group, send email to google-we...@googlegroups.com.
>>>
>>>
>>>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "GWT Users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/google-web-toolkit/nmBAOX4vcSo/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> google-web-toolkit+unsubscr...@googlegroups.com <javascript:>.
>> To post to this group, send email to google-we...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to