You can't, what you do here is that you create new (and empty)
JavaScriptObject, and cast it to your type. It seems that you think
you're copying the object, but that's certainly not true. I'm not sure
what the problem is, if you need to pass that instance to another
class, you can do it without any tranformation.

On Dec 10, 11:08 am, julio <antongiuli...@gmail.com> wrote:
> Hi,
>
> In my application I get some data via JSONP, and it's perfectly
> "transformed" in a bean composed by String, JsArray,
> JsArray<JsArrayString>, etc. At some point this bean is "saved" with
> something like this:
>
> private static JavaScriptObject data;
>
> ...
> BeanData b;
> MyClass.data = b;
>
> in another point of the application this value is passed to another
> class (to display some other page) with something like this:
>
> BeanData bd = data.createObject().cast();
> String name = bd.getName();
>
> but name is "empty".
> After debugging the "bd" variable, it's still a "JavaScriptObject".
> How can I cast it back?
>
> Thanks,
> Julio

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@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