On 4 sep, 11:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Thanks for the answer.
>
> What I also considered was to create an javascript object manually
> that had the correct structure so GWT was fooled, but this would
> require knowledge of how GWT implements classes on the client side and
> also it would be dependent on implementation specifics of the current
> GWT version. Would that be possible(event thought I know it wouldn't
> be sensible).
There's a proposal on the table to allow a JavaScriptObject to
implement an interface in certain conditions, but it's still just a
proposal, not even an experiment AFAIK.
If you want a User JSO, for whatever reason, do it like this:
public final class User extends JavaScriptObject {
public native String getName() /*-{ return this.name; }-*/;
public native void setName(String name) /*-{ this.name = name }-
*/;
...
}
...
User u = JavaScriptObject.createObject().cast();
If you want a JSO but need and interface, create a class implementing
the interface that wraps a JSO (instead of inheriting JavaScriptObject)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---