PDA

View Full Version : Starting GWT in Eclipse



dtondo
26 Jul 2009, 7:54 PM
Hi people, it don`t know how make Gwt work in Eclipse.

I have think that i configured everything, but in the end, it is not showing up.

Some one can help me?

Thanks

my html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Web Application Starter Project</title>
<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />
</head>

<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>
</body>
</html>


my xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='app'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.extjs.gxt.ui.GXT'/>

<!-- 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.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->

<!-- Specify the app entry point class. -->
<entry-point class='biblioteca.client.App'/>


</module>


and here is a screen showing nothing... :/
http://yfrog.com/0y63263249p

micgala
26 Jul 2009, 11:32 PM
Hi.

How is your EntryPoint defined?

dtondo
27 Jul 2009, 5:16 AM
Hi.

How is your EntryPoint defined?

yes
<entry-point class='biblioteca.client.App'/>

is that right?

micgala
27 Jul 2009, 5:25 AM
Yes, but I mean the java class itself.

What is your implementation of that?
I just wanted to see if you are displaying it correctly.

dtondo
27 Jul 2009, 7:03 AM
hummm.

yes, it is a simple start sample... :(

javacode:

package biblioteca.client;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class App implements EntryPoint {
@Override
public void onModuleLoad() {
ButtonBar bar = new ButtonBar();
bar.add(new Button("Click-me", new SelectionListener<ButtonEvent>() {

@Override
public void componentSelected(ButtonEvent ce) {
MessageBox.confirm("Demo", "GXt is realy good", null);
}
}));
RootPanel.get().add(bar);
MessageBox.confirm("Demo", "GXt is realy good", null);
}
/**
* The message displayed to the user when the server cannot be reached or
* returns an error.
*/

}



Yes, but I mean the java class itself.

What is your implementation of that?
I just wanted to see if you are displaying it correctly.

micgala
27 Jul 2009, 7:17 AM
You are using

<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />

This resources folder is in your war folder?

I cannot notice any problem in your code...

Are you sure you are using GWT 1.6 or 1.7?
Are you sure gxt.jar is in your classpath?

dtondo
27 Jul 2009, 10:11 AM
I'm using GWT 1.7

here is some config screens. May it help find the problem...

http://img200.imageshack.us/img200/7830/40756328.png
http://img210.imageshack.us/img210/7184/54697472.png
http://img11.imageshack.us/img11/8375/14315986.png
http://img35.imageshack.us/img35/4595/12776897.png
http://img210.imageshack.us/img210/8493/39365757.png
http://img89.imageshack.us/img89/882/41219087.png
http://img89.imageshack.us/img89/2135/46404534.png
http://img210.imageshack.us/img210/3772/75677339.png
http://img35.imageshack.us/img35/6148/75748334.png

hummm i configure my class path with these libraries:
http://img216.imageshack.us/img216/6493/32683916.png


i don't know that i'm doing wrong :-?...


You are using

<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />

This resources folder is in your war folder?

I cannot notice any problem in your code...

Are you sure you are using GWT 1.6 or 1.7?
Are you sure gxt.jar is in your classpath?

msauter
28 Jul 2009, 12:08 AM
I pasted your code into my "onModuleLoad" and it worked without problems.

http://img269.imageshack.us/img269/7175/temppic.png

I think that the problem could be there:

<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />

Are you sure you have the css-file located there?

../biblioteca.app/war/resources/css/gxt-all.css

imran
28 Jul 2009, 12:17 PM
It worked for me too.

One thing I noticed in your HTML is that you don't include the [module].nocache.js generated file.

For example


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


Keep in mind that you can always troubleshoot this using Firebug