Re: Accessing "basic" JS Object in JsInterop callback

2017-08-20 Thread Vassilis Virvilis
Great thought. It could save me some hours/days of modeling the Config Object in java. On the other hand my Config Object is strictly typed with all the usual benefits. On the other hand (apparently the discussion requires 3 hands :) my java Config Object is not complete. I have defined only

Re: Accessing "basic" JS Object in JsInterop callback

2017-08-20 Thread Tony BenBrahim
regarding 1) It would be nice to initialize Objects from json. What would happen if the json text specifies members not in class though? You could always do this, if you just need to pass something to JavaScript and do not need to read it... @JsType(isNative=true, name="JSON",

Re: Accessing "basic" JS Object in JsInterop callback

2017-08-15 Thread Jens
> package xxx; > > import jsinterop.annotations.JsFunction; > > @JsFunction > public interface Callback { > void call(Object event); > } > If the JS library does not pass totally different JS objects into the callback but instead something that is worth defining as a class you can use

Re: Accessing "basic" JS Object in JsInterop callback

2017-08-15 Thread Vassilis Virvilis
I don't think his problem was the callback. This is easily jsinteropified with @JsFunction. I think his problem was initializing Object with json Vassilis On Tue, Aug 15, 2017 at 1:41 PM, Kirill Prazdnikov wrote: > What prevents you using a proper JsType for callback

Accessing "basic" JS Object in JsInterop callback

2017-08-15 Thread Kirill Prazdnikov
What prevents you using a proper JsType for callback arg ? public interface Callback { void call(ArgT event); } @JsType inerface ArgT { @JsProperty A getA(); @JsProperty B getB(); // e.t.c } -- You received this message because you are subscribed to the Google Groups "GWT Users"

Re: Accessing "basic" JS Object in JsInterop callback

2017-08-13 Thread Vassilis Virvilis
I had this problem with DataTables Config. DataTables is a nice javascript library for tables https://datatables.net/ and Config is the initialization object like yours. So here is what I did: @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object") public static class

Accessing "basic" JS Object in JsInterop callback

2017-08-13 Thread Andrea Martino
Hi all, I have recently started testing JsInterop for our GWT 2.8.1 application and I have encountered a situation I could not solve without using the old style JSNI approach. Consider the following minimal JS library I would like to use in Java/GWT: (function (window, document, undefined) {