I can't think of a single usecase where it would be appropriate to load a
module twice ... It would be effectively the same as loading YUI, or Dojo, or
jQuery twice, Once it is there the first time there's no need to load it again,
the code is already there.
If you are simply trying to place a panel in multiple places on the page, that
can be done from the single invocation of your module, look for the container
elements in the DOM and add your panel (widgets)
RootPanel.get("contianer1").add(myStuff);
RootPanel.get("container2").add(anotherInstanceOfMyStuff);
-jason
On Dec 29, 2009, at 6:39 PM, Ian Bambury wrote:
> Why would you want to run it twice? What effect are you trying to produce?
>
> Ian
>
> http://examples.roughian.com
>
> 2009/12/30 lineman78 <[email protected]>
> Can someone please tell me if it is possible to load the same module
> twice. If so, how? I have tried including the script tag twice,
> which used to work in older versions of gwt, but no longer works. I
> was thinking that once it is loaded you could call the onModuleLoad
> function manually, but cannot find how that would work. Another thing
> I noticed is that if you do include the script tag twice, it writes
> the code to the dom twice, but it is only executed once. If it is by
> design that you can only run a module once by including the script
> tag, maybe this ought to be prevented. I also tried using the cross
> site linker, which is what i believe i used before to get this to
> work.
>
> <module>
> <define-linker name="xs" class="com.google.gwt.core.linker.XSLinker"/
> >
> <add-linker name="xs"/>
>
> <inherits name="com.google.gwt.user.User" />
> <source path="client" />
>
> <define-property values="hello,goodbye,default" name="alerter" />
>
> <property-provider name="alerter">
> <![CDATA[
> var alerter = $wnd.gwttester_alerter;
> if (alerter == null){
> alerter = "default";
> }
> return alerter;
> ]]>
> </property-provider>
>
> <replace-with class="com.gwt.client.alert.impl.HelloAlerter">
> <when-type-is class="com.gwt.client.alert.Alerter" />
> <when-property-is name="alerter" value="hello" />
> </replace-with>
>
> <replace-with class="com.gwt.client.alert.impl.GoodbyeAlerter">
> <when-type-is class="com.gwt.client.alert.Alerter" />
> <when-property-is name="alerter" value="goodbye" />
> </replace-with>
>
> <replace-with class="com.gwt.client.alert.impl.DefaultAlerter">
> <when-type-is class="com.gwt.client.alert.Alerter" />
> <when-property-is name="alerter" value="default" />
> </replace-with>
>
> <entry-point class="com.gwt.client.GWTClient"></entry-point>
> </module>
>
> <html>
> <head>
> <meta http-equiv="content-type" content="text/html;
> charset=UTF-8">
> <title>index</title>
> </head>
> <body>
> <div>
> <script type="text/javascript">var gwttester_alerter =
> 'hello';</
> script>
> <script type="text/javascript" language="javascript"
> src="com.gwt.GWTTester.nocache.js"/>
> </div>
> <div>
> <script type="text/javascript">var gwttester_alerter =
> 'goodbye';</
> script>
> <script type="text/javascript" language="javascript"
> src="com.gwt.GWTTester.nocache.js"/>
> </div>
> </body>
> </html>
>
> --
>
> 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.
--
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.