Hi!
I'm trying to move my app from GWT v1.4 to 1.5.2 and experienced a
strange problem. All GWT widgets does not like to be placed at the
<div id="slot1"></div>. Let's see the listings: I want the GWT button
to be placed between
"GWT module begin" and "GWT module end", but it appears after "GWT
module end" only.
Does anybody have the same trouble?
Thanks
Listing 1. HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>
<body>
<script type="text/javascript"
src="org.osminog.gwt.test.Test/
org.osminog.gwt.test.Test.nocache.js"></script>
<p>GWT module begin (org.osminog.gwt.test.Test)</p>
<div id="slot1"> </div>
<p>GWT module end</p>
</body>
</html>
Listing 2. GWT widget
package org.osminog.gwt.test.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
public class TestModule implements EntryPoint {
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get("slot1");
HorizontalPanel mainPanel = new HorizontalPanel();
Button b = new Button("Click me", new ClickListener() {
public void onClick(Widget sender) {
Window.alert("Hello, AJAX");
}
});
mainPanel.add(b);
if (rootPanel != null){
rootPanel.add(mainPanel);
}else{
Window.alert("div-gwt is null");
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---