Saturday, November 28, 2015

Re: JSInterop sample / tutorial?

Is the @JsFunction stuff idempotent? (I'm not sure what the correct term to use is.)

The main thing is, does this work?

   @JsFunction Function { ... }

   Function listener = (evt) => { evt.preventDefault(); };

   doc.addEventListener("click", listener);

then later on

   doc.removeEventListener("click", listener);

It looks like it should be fine, but I just want to make sure.

Also, I sometimes had problems with the old JSNI stuff when using optional parameters in JS. I'm not sure why, but sometimes GWT would complain. Does that work ok in JsInterop?

   doc.addEventListener("click", listener);
   doc.addEventListener("click", listener, false);

I know with GWT Elemental, it would always complain about the first case.


On Tuesday, 24 November 2015 09:47:20 UTC-5, Jens wrote:

Any updates about the starting guide of JSInterop?

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

No comments:

Post a Comment