Wednesday, October 26, 2016

Re: Setting a variable in the window namespace

Update:  I was able to sort of figure it out, but still had to use a bit of JSNI. Thought I would share the solution below.   As background I was trying to store a function in the window namespace.


interface MyFunction {

     void run(String x);


//maybe another way to get the window without JSNI, but good enough for me

public native MyWindow get() /*-{

   return $wnd;


@JsType(isNative = true)

public static class MyWindow {


    public MyFunction f;


Then, in javascript I can now call

window.f("some string");

On Tuesday, October 25, 2016 at 4:42:21 PM UTC-7, Paul Mazzuca wrote:
Is there an equivalent way of using JSInterop to achieve the JavaScript functionality of = 'someval'?

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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment