Friday, August 19, 2016

Re: Best Practice for JSON object recreation on client



Am Freitag, 19. August 2016 11:43:12 UTC+2 schrieb zakaria amine:
I have tried something like: 

@JsType(namespace=GLOBAL)
public class Record {
String id;
String date;
String data;
public Record() {
}
}

By default @JsType property "isNative" is false, so your Record class is a non-native class that might get exported to JS if you use -generateJsInteropExports during compilation. If you don't use that flag the @JsType is treated as a normal class I guess.

You should use @JsType(isNative=true, namespace=GLOBAL, name="Object") so that your Record class becomes a plain JavaScript object

-- J.

--
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+unsubscribe@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.

No comments:

Post a Comment