Saturday, December 21, 2013

Re: Multi Modules


ok thanks.. really i don't understand where i fail.. these is my folders
- war
     -  module1
           + gwt
           - module1.nocache.js
     - module2
           + (no gwt folder??? why??))
           - module2.nocache.js
     - WEB-INF
           - client
           - server
           - shared
           - module1.xml
           - module2.xml
     - CSS
     - module1.HTML
     - module2.HTML

These is my 2 XML
module1 (DoppioModulo)
<?xml version="1.0" encoding="UTF-8"?>

<!-- When updating your version of GWT, you should also update this DTD reference, so that your app can take advantage of the latest GWT module capabilities. -->

<!DOCTYPE module SYSTEM "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd" PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN">
-<module rename-to="doppiomodulo"> 
<!-- Inherit the core Web Toolkit stuff. -->
 <inherits name="com.google.gwt.user.User"/> 
<!-- Inherit the default GWT style sheet. You can change -->
 
<!-- the theme of your GWT application by uncommenting -->
 
<!-- any one of the following lines. -->
 <inherits name="com.google.gwt.user.theme.clean.Clean"/> 
 
<!-- Other module inherits -->
 
<!-- Specify the app entry point class. -->
 <entry-point class="com.prova.client.DoppioModulo"/> 
<!-- Specify the paths for translatable code -->
 <source path="client"/> 
<source path="shared"/> 

</module>


module2.xml (Secondo)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd" PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN">
-<module rename-to="secondo"> 
<inherits name="com.google.gwt.user.User"/> 
<source path="client"/> 
<entry-point class="com.prova.client.SecondoEntry"/> 
</module>


My 2 HTML
Module1
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <!--                                                               -->
    <!-- Consider inlining CSS to reduce the number of requested files -->
    <!--                                                               -->
    <link type="text/css" rel="stylesheet" href="DoppioModulo.css">

    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>Web Application Starter Project</title>
    
    <!--                                           -->
    <!-- This script loads your compiled module.   -->
    <!-- If you add any GWT meta tags, they must   -->
    <!-- be added before this line.                -->
    <!--                                           -->
    <script type="text/javascript" language="javascript" src="doppiomodulo/doppiomodulo.nocache.js"></script>
  </head>

  <!--                                           -->
  <!-- The body can have arbitrary html, or      -->
  <!-- you can leave the body empty if you want  -->
  <!-- to create a completely dynamic UI.        -->
  <!--                                           -->
  <body>

    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    
    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
    <noscript>
      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
      </div>
    </noscript>

    <div id="con" ></div>
  </body>
</html>


Module2
<!doctype html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>SecondaPag</title>
    <script type="text/javascript" language="javascript" src="secondo/secondo.nocache.js"></script>
  </head>

  <body>
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
  </body>
</html>

Thanks in advance

Davide


On Thu, Dec 19, 2013 at 6:57 PM, Jens <jens.nehlmeier@gmail.com> wrote:
If i don't inherit the module however the class doesn't run!! 

Then you have missed something. Maybe you have a typo somewhere (check if your <script> tag in your HTML pages are correct). In general its not problem to have 2 HTML pages each initializing a different, single GWT EntryPoint. 

As soon as you inherit GWT modules that each have entry points then all entry points will be started by GWT in an undefined order. So make sure your entry point modules do not inherit from each other. If you want to share code, then create a new GWT module without an entry point and inherit it everywhere you need it.

Feel free to post your *.gwt.xml and *.html files if you think they are correct but it is still not working.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.



--
Davide Micheletti

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment