Right, if you want to enumerate the fieldnames of a JSON object, then
you'd probably have to use the JSON parser.
You could probably use a JSNI method in an overlay type to return an
array of field names, then have another JSNI method in the object that
would return the field, the problem becomes handling field types. you
return a JavascriptObject, but that object is opaque, you don't really
have any way to determine its actual type, so you would have been
better off just parsing in the first place.
-jason
On Oct 26, 2008, at 9:08 AM, mat wrote:
>
> Hi,
>
> In Javascript its possible to enumerate Javascript Objects:
>
> e.g:
>
> var my obj = {"key1": "value 1","key2":"value 2", "key3","value3"};
>
> for (var key in obj)
> {
> var currentValue = obj[key];
> };
>
> I would like to know how to do this with Javascript Overlay Types in
> GWT.
>
> Thanks in advance!
>
> Thanks,
> Mathew
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
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
-~----------~----~----~----~------~----~------~--~---