Friday, December 10, 2010

Re: Casting JavaScriptObject with GWT 2.1

Hi Julio,

I think you need to first understand JavaScript before jumping on to
using GWT.

Once you are done, and you understand why JavaScriptObject instances
can be type-"cast"ed from one type to another without giving any
compiletime or runtime errors, you will automatically have solution to
your problem!


--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.com

On Dec 10, 9:08 pm, julio <antongiuli...@gmail.com> wrote:
> weird, it looks like i can pass through classes primitive values as
> int, char etc but not complex objects extending JavaScriptObject, cos
> I cannot cast them anymore (BTW no errors got, just empty values)
>
> Julio
>
> On Dec 10, 10:43 am, julio <antongiuli...@gmail.com> wrote:
>
> > before this:
>
> > BeanData bd = data.createObject().cast();
>
> > I tried with a normal:
>
> > BeanData bd = (BeanData) data;
>
> > and:
>
> > BeanData bd = data.cast();
>
> > but they don't work.
>
> > BTW debugged them I saw that the data passed has the same refId of the
> > "original", so it looks like is just not cast at all.
>
> > On Dec 10, 10:22 am, skrat <dusan.malia...@gmail.com> wrote:
>
> > > 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.
>
>

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate