RootPanel.get(String id) - GWT Project vs. Designer Project

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

RootPanel.get(String id) - GWT Project vs. Designer Project

Postby allioop70 » Tue Jan 30, 2007 10:47 am

I have been following the example's in Ed Burnette's E-book "Google Web Toolkit - Taking the pain out of Ajax." When I got to section 5.4 on GWT RPC basics, I created a new project using the GWT command line scripts projectCreator and applicationCreator, creating an Eclipse project. I imported the project into Eclipse, created all the files in the example and it ran as expected.

Then I created a GWT Designer project from Eclipse. I created the module using Designer's built-in module creation functionality. Everything seemed to go well, until I tried to run the project. It wouldn't work.

Ed's example uses a table in the HTML file that the GWT scripts create.
<table align=center>
<tr>
<td id="slot1"></td><td id="slot2"></td>
</tr>
</table>

In the EntryPoint java class, he uses the following to add a widget to the cells in the table based on ID.
Button button = new Button("Click Me");
RootPanel.get("slot1").add(button);

This functionality works fine in the GWT created project, but when I copy the table to the HTML file in the Designer project, the GWT code fails to find the DOM element with the ID "slot1." I get a NullPointerException on the RootPanel line.

I created the GWT project and the Designer project's again. This time, I didn't add any modules, I only copied the HTML table to the Designer project and added one line to the EntryPoint java class: RootPanel.get("slot1").add(button);

The GWT project worked, the Designer project fails.

According the the JavaDocs, this method should work as expected and as it works in the GWT project.

Any idea why it doesn't work in a Designer project?

Thanks!
allioop70
 
Posts: 13
Joined: Mon Jan 29, 2007 2:57 pm
Location: Colorado

Re: RootPanel.get(String id) - GWT Project vs. Designer Proj

Postby Eric Clayberg » Wed Jan 31, 2007 8:38 am

allioop70 wrote:Any idea why it doesn't work in a Designer project?

No. If you want to send us a test case and your Eclipse ".log" file, we can take a look at it.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: RootPanel.get(String id) - GWT Project vs. Designer Proj

Postby allioop70 » Wed Jan 31, 2007 1:13 pm

Eric Clayberg wrote:
allioop70 wrote:Any idea why it doesn't work in a Designer project?

No. If you want to send us a test case and your Eclipse ".log" file, we can take a look at it.


I would be more than happy to.

The test case really is above, but I will resend that.

Where do I find the Eclipse log file?

Where do you want me to send this information?

Thanks!
allioop70
 
Posts: 13
Joined: Mon Jan 29, 2007 2:57 pm
Location: Colorado

Re: RootPanel.get(String id) - GWT Project vs. Designer Proj

Postby Eric Clayberg » Wed Jan 31, 2007 3:02 pm

allioop70 wrote:The test case really is above, but I will resend that.
Where do I find the Eclipse log file?
Where do you want me to send this information?

The Eclipse ".log" file is always in your workspace .metadata directory.

The product support address is wb-support@instantiations.com.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests