I am also having a similar use case where i need to dynamically insert a module in a current gwt entry point/page.
Any one? Thanks Ashish On Thu, Nov 5, 2009 at 3:32 AM, John O'Conner <[email protected]> wrote: > > Did you ever get a helpful answer for this? I have the same problem as > described by the original poster but I'm unable to load my GWT module > dynamically with a <script> tag. Still hoping for an answer to > this.... > > -- > John > > On Oct 29, 1:49 am, grue <[email protected]> wrote: >> Hi, >> >> I've got a similar problem. I have embeddeed a GWT module in an >> existing application and need the module do be loaded _after_ an >> asynchronous request is made. Loading the module via document.write >> (...) works fine when the page is loaded (as you mentioned) but now I >> run into the issue >> that it doesn't load properly after the asynchronous request has >> completed (and the page is loaded). All I get is a blank page. >> >> Does anyone have an idea what's causing this? >> >> Best regards, >> Michael >> >> On Oct 19, 5:24 pm, bgoetzmann <[email protected]> wrote: >> >> >> >> > Sorry, >> >> > It seems that the solution I proposed works only when page is loading, >> > not when page is loaded. But it solves my specific problem. >> >> > Cheers, >> >> > Bertrand. >> >> > On 19 oct, 18:01, bgoetzmann <[email protected]> wrote: >> >> > > Finally, there is a solution! >> >> > > The solution I propose here to generate thescripttag (that permits >> > > to inject the GWTmodule) is to use the document.write JavaScript >> > > statement. >> > > In the example bellow, the generation of thescripttag depends of >> > > some condition >> >> > > <scriptlanguage="javascript"> >> > > if (!isomorphicDir) { >> > > ... >> > > document.write('<scripttype="text/javascript" >> > > language="javascript" src=".../.../ >> > > com.lsy.clink.reports.Main.nocache.js"><\/script>'); >> > > } >> > > </script> >> >> > > An important point to note is on the closingscripttag: the / >> > > character is escaped: \/. >> >> > > In my application, a JSP generates this part for a GWT portlet. >> >> > > I tried others solutions like add ascripttag element using DOM on >> > > the body element, but without success. >> >> > > Hope this help! >> >> > > Bertrand. >> >> > > On 5 oct, 16:07, bgoetzmann <[email protected]> wrote: >> >> > > > Is someone have some idea to do that? >> >> > > > Bertrand ;-) >> >> > > > On 24 sep, 21:29, Raziel <[email protected]> wrote: >> >> > > > > I have a similar problem. I need to be able toloadmy entry point >> > > > > class without using ascripttag. >> >> > > > > The .nocache.jsscriptdepend on being loaded through the tag since it >> > > > > uses the src attribute to find the location of the other .js files. >> >> > > > > I thought doing something like what you did here (creating a new >> > > > >scripttag and adding it directly to the DOM) would be enough. >> > > > > However, the document.write either doesn;t work, or the logic to >> > > > > place >> > > > > a marker tag and get a siblingscriptto obtain the src doesn't always >> > > > > get the right tag (it gets other tags that I'm including in my page). >> >> > > > > So basically I'd like to know the same thing: how can Iload >> > > > > the .nocache.jsscriptwithout using a hardcodedscripttag. >> >> > > > > On Sep 23, 10:51 am, bgoetzmann <[email protected]> wrote: >> >> > > > > > Thank you Thomas, >> >> > > > > > I searched on the GWT source code, and learnt several things on >> > > > > > linkers. For the moment, what can interest me is how I could modify >> > > > > > the ...Main.nocache.js file. I thought find a template... >> > > > > > Any idea about this? >> >> > > > > > - Bertrand. >> >> > > > > > On 19 sep, 00:53, Thomas Broyer <[email protected]> wrote: >> >> > > > > > > On 17 sep, 18:32, bgoetzmann <[email protected]> >> > > > > > > wrote: >> >> > > > > > > > Hello, >> >> > > > > > > > I'm developing a GWT 1.6 application with SmartGWT; the >> > > > > > > > application >> > > > > > > > works well! The web page's body I use has of course the code >> > > > > > > > bellow to >> > > > > > > >loadthe application: >> >> > > > > > > > <scriptlanguage="javascript" >> > > > > > > > src="/...Main.nocache.js"></script> >> >> > > > > > > > I search a way todynamicallyloadthe application but without >> > > > > > > > success; for example, on a link with code like this, in order >> > > > > > > > to add a >> > > > > > > >scripttag to the page's document: >> >> > > > > > > > <a href="javascript:f()">test</a> >> >> > > > > > > > Having f defined like this: >> > > > > > > > function f() { >> > > > > > > > varscript= document.createElement('script'); >> > > > > > > > script.setAttribute('type', 'text/javascript'); >> > > > > > > > script.setAttribute('src', '/...Main.nocache.js'); >> > > > > > > > >> > > > > > > > document.getElementsByTagName('body')[0].appendChild >> > > > > > > > (script); >> >> > > > > > > > } >> >> > > > > > > > But it soesn't work;the behavior is even strange because the >> > > > > > > > entire >> > > > > > > > page content is replaced by the tag html containg a sery >> > > > > > > > ofscript >> > > > > > > > tags. >> >> > > > > > > That's because the selection scripts (nocache.js) use >> > > > > > > document.write() >> >> > > > > > > > How can I achieve a dynamicload? >> >> > > > > > > You'd have to write your own selectionscript. Search the group >> > > > > > > archives and look at Linkers. > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en > -~----------~----~----~----~------~----~------~--~--- > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
