GWT1.4 Getting Started Guide not working...

2 views
Skip to first unread message

idan...@gmail.com

unread,
May 30, 2007, 5:47:26 AM5/30/07
to Google Web Toolkit
Hello,
I am trying to build eclipse project as I did with my GWT1.3
application:

projectCreator.cmd -eclipse GWT1_4

and then:

applicationCreator.cmd -eclipse GWT1_4 com.test.client.Gwt

and it build the project and all BUT

When I amtrying to run the class Gwt (EntryPoint) using the eclipse
The html loaded with the original sample text
And the widgets (Label & the "click me" Button ) not loading

what is wrong?

I have also onother question,
How do I upgrade my GWT1.3 application to GWT1.4?

Thanks,
Idan

bch...@gmail.com

unread,
May 30, 2007, 6:49:59 AM5/30/07
to Google Web Toolkit
Greetings,

How did you run the program in Eclipse ? What command did you
execute ? Where did you load the html ? What is the url of the html
page you loaded ?

Answers to the above questions would help troubleshoot the problem.

Reinier Zwitserloot

unread,
May 30, 2007, 7:43:38 AM5/30/07
to Google Web Toolkit
To upgrade, just start compiling with GWT 1.4 instead of 1.3. You can
either delete your GWT 1.3 directory and copy GWT 1.4 'over it', or if
you don't want to do that, just go into every batch file and the
eclipse run targets, and update any directory reference to the 1.3 dir
to the 1.4 dir.

On May 30, 11:47 am, "idanel...@gmail.com" <idanel...@gmail.com>
wrote:

idan...@gmail.com

unread,
May 30, 2007, 8:08:57 AM5/30/07
to Google Web Toolkit
Hi,
Thanks for your quick reply!
The answers to your questions bellow
Thanks alot Idan


1. I did on the class "run as GWT application" - it's the same way I
did in my other application (GWT1.3)
2. The EntryPoint class is GwStart
3. The URL is: http://localhost:8888/com.test.GwStart/GwStart.html
4. I did load the page directly - I did it via the simulator BUT also
directly it not working


The class source is:
----------------------------------------
public void onModuleLoad() {
final Button button = new Button("Click me");
final Label label = new Label();

button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (label.getText().equals(""))
label.setText("Hello World!");
else
label.setText("");
}
});

// Assume that the host HTML has elements defined whose
// IDs are "slot1", "slot2". In a real app, you probably would
not want
// to hard-code IDs. Instead, you could, for example, search for
all
// elements with a particular CSS class and replace them with
widgets.
//
RootPanel.get("slot1").add(button);
RootPanel.get("slot2").add(label);
}

The GwStart.gwt.xml:
----------------------------------------
<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<!-- Specify the app entry point class. -->
<entry-point class='com.test.client.GwStart'/>

</module>

GwStart.htmll:
----------------------------------------
<html>
<head>

<title>Wrapper HTML for GwStart</title>
<style>
body,td,a,div,.p{font-family:arial,sans-serif}
div,td{color:#000000}
a:link,.w,.w a:link{color:#0000cc}
a:visited{color:#551a8b}
a:active{color:#ff0000}
</style>

<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script language='javascript' src='com.test.GwStart.nocache.js'></
script>
</head>
<body>

<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:
0;height:0;border:0"></iframe>

<h1>GwStart</h1>

<p>
This is an example of a host page for the GwStart application.
You can attach a Web Toolkit module to any HTML page you like,
making it easy to add bits of AJAX functionality to existing pages
without starting from scratch.
</p>

<table align=center>
<tr>
<td id="slot1"></td><td id="slot2"></td>
</tr>
</table>
</body>
</html>

Arthur Lance

unread,
May 30, 2007, 8:27:35 AM5/30/07
to Google-We...@googlegroups.com
k. For some reason looking at the html source code.
It is missing the meta tag that points to the default class
 
 <meta name='gwt:module' content='com.test.client.GwStart'>
next the javascript source should be pointing to
  <script language="javascript" src="gwt.js"></script>

idan...@gmail.com

unread,
May 30, 2007, 8:37:28 AM5/30/07
to Google Web Toolkit
But until now,
the gwt1.3 created the html file with the <meta name='gwt:module'
content='com.test.client.GwStart'>
And the gwt1.4 didn't and also the samples of the gwt1.4
for example "mail" - Mail.html
like this:
<html>
<head>
<title>Mail App</title>
</head>
<body>
<script language='javascript'
src='com.google.gwt.sample.mail.Mail.nocache.js'></script>
</body>
</html>


And works well

so I think it should have work for me as well

do you know why Mail.html works and GwStart.html doesn't ?

Thanks,
Idan

Bernard Choi

unread,
May 30, 2007, 10:04:11 AM5/30/07
to Google-We...@googlegroups.com
I'm inclined to think there's an error introduced when migrating between the two versions.

Could you try running the application from the command line to eliminate "run as GWT application" as the problem ?

Are you using some plugin to eclipse ?


Reinier Zwitserloot

unread,
May 30, 2007, 10:27:03 AM5/30/07
to Google Web Toolkit
Ah, yes - the difference is of course in the bootstrapping procedure,
I should have realized.

Bootstrapping has changed between GWT 1.4 and GWT 1.3. The 'gwt.js'
file is no longer required. For some reason my gwt.js - using
bootstrapper still works fine in GWT 1.4, but now that you've shown
some code you've basically changed nothing from the standard hello
world example, so just start over.

On May 30, 4:04 pm, "Bernard Choi" <bch...@gmail.com> wrote:
> I'm inclined to think there's an error introduced when migrating between the
> two versions.
>
> Could you try running the application from the command line to eliminate
> "run as GWT application" as the problem ?
>
> Are you using some plugin to eclipse ?
>

> --
> Well Wishes,
> Bernard Choi

idan...@gmail.com

unread,
May 30, 2007, 10:47:03 AM5/30/07
to Google Web Toolkit
Hi
I don't know how, BUT it started to work :)
Thanks alot,
Idan

Reply all
Reply to author
Forward
0 new messages