Friday, May 31, 2013

How would like to load the GWT module dyanamically basing on the click of respective link?

I would like to load different gwt modules withIn the main div basing on the click of respective menuItem. I would like to use JQuery. In the below code, I would like to load the fooGwt module if we click on theloadFooModule and similarly, if I click on loadJqueryModule link then JQuery gwt moduleshould be loaded.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">  <%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>  <%@ taglib prefix="menuItem" uri="menuItem" %>  <html>   <head>    <script src=""></script>      <script>    $(document).ready(function() {      $("a").click(function() {            $("#fooModule").empty();            $("#jQueryModule").empty();        $("#main").remove();            alert($(this).text());            if ($(this).text() == "loadJqueryModule") {                    // Jquery gwt module.                $('head').append($("<script id='main' src='/jquery/jquery.nocache.js' />"));             } else {                     // Foo GWt module.                $('head').append($("<script id='main' src='/foo/foo.nocache.js' />"));             }      });    });     </script>   </head>   <body>     <h1>Web Application Starter Project</h1>      <a href="#" id="clickMe">loadFooModule</a>      <a href="#" id="clickMe5">loadJqueryModule</a>      <div id="fooModule">      </div>            <div id="jQueryModule">      </div>         </body>  </html>

O/p: In this it is loading one module which is Foo. The other module was not loading.

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

No comments:

Post a Comment