Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

SmartGWT- Why does it not work?

$
0
0
Hey!

I started to try Smart GWT development, but I don't can run it. I am using eclipse 4.4 with GWT 2.6 and SmartGWT 4.0. I followed several tutorials, which should show how to setup a SmartGWT project.
My problem is that my widgets, which I add in onModuleLoad are not displayed in the browser, just the default HTML-sheet.
I tried a lot, but I don't get it.

My code:

onModuleLoad
Code:


        public void onModuleLoad() {
               
               
        final IButton button = new IButton("Hello");
       
        button.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                       
                        @Override
                        public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                                // TODO Auto-generated method stub
                                SC.say("Hello ");
                        }
                });
       
        VLayout vl= new VLayout();
        vl.setSize("100%", "100%");
        vl.addMember(button);
       
       
        RootPanel.get().add(vl);

GWT.XML
Code:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.0//EN"
  "http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='test'>
                        -->
<inherits name='com.google.gwt.user.User'/>

<inherits name="com.smartgwt.SmartGwt"/>

<source path='client'/>
<source path='shared'/>


</module>

My HTML-File

Code:


<!doctype html>


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

    <link type="text/css" rel="stylesheet" href="Test.css">

    <title>Web Application Starter Project</title>
   
   
    <script>var isomorphicDir="test/sc/";</script>
<script type="text/javascript" language="test/test.nocache.js"></script>
</head>

    <script type="text/javascript" language="javascript" src="test/test.nocache.js"></script>
  </head>

  <body>

    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
   
    <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>

    <h1>Web Application Starter Project</h1>

    <table align="center">
      <tr>
        <td colspan="2" style="font-weight:bold;">Please enter your name:</td>       
      </tr>
      <tr>
        <td id="nameFieldContainer"></td>
        <td id="sendButtonContainer"></td>
      </tr>
      <tr>
        <td colspan="2" style="color:red;" id="errorLabelContainer"></td>
      </tr>
    </table>
  </body>
</html>

WEB-XML

Code:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        version="2.5"
        xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
  <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>test.test.server.GreetingServiceImpl</servlet-class>
  </servlet>
 
  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/test/greet</url-pattern>
  </servlet-mapping>
 
  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>Test.html</welcome-file>
  </welcome-file-list>

</web-app>

Maybe one of you can find my problem, because I really don't know, what the problem is.
Please, please help me!


Peter

Viewing all articles
Browse latest Browse all 4756

Trending Articles