Friday, June 3, 2016

Re: jsinterop: GWT app as a widdget: default script injection fails.

I haven't thought of multiple gwt widgets (I am struggling with one).

Obviously you are correct in what you are saying. It would be cool if we could feed jsinterop the scope per js injection. However I can't imagine how that would be. You may need to change your interface (namespace argument) in lots of points depending if the script is loaded at the top level or in gwt iframe. Maybe jsinterop N+1?

One very big problem is the beating you have to perform to bring the foreign js libraries into shape for that type of inclusion. Probably anything UI related would have a problem unless is very well written.

A more clear solution if of course https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Isolated-Imports-Proposal.md for anybody that has a time machine handy and doesn't mind a trip to the future... :-)

Thanks for the tips and the reassurance I am not alone in a corner case that doesn't exist.

   Vassilis



On Fri, Jun 3, 2016 at 4:51 PM, Jens <jens.nehlmeier@gmail.com> wrote:
Probably needs to be updated a bit if you want to run multiple GWT apps with different names/iframes as widgets on the page as you need a global variable per app then.

If you know everything is served from the same domain you can probably also use window.frames['appId'].contentWindow 

But yes, would be nice if JsInterop would provide a shortcut to generate a reference to the iframe automatically if desired.

-- 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.



--
Vassilis Virvilis

--
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