Multiple root panels - Howto

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

Multiple root panels - Howto

Postby techphd » Mon Nov 29, 2010 5:55 pm

What is the correct way to use GWT Designer to create multiple panels that will be loaded into one web page.
I would like to keep the panels all in one class and have them use different div ids to load in various places on a static webpage.

I'm new to GWT Designer / instantiations and hope this question has a simple howto solution.
The GWT StockWatcher application shows a simple example that uses multiple root panels and won't load in GWT Designer. ... l#hostpage

The html page uses <div id="stockList"></div>
Within the class StockWatcher which implements EntryPoint the following code
// Associate the Main panel with the HTML host page.
RootPanel rootPanelStockList = RootPanel.get("stockList");

This code places the mainPanel into the html page, Instead of replacing the entire page as is done in the GWT Designer StockWatcher application example.

The StockWatcher example also decides dynamically whether to load the mainPanel or the loginPanel. I understand why GWT Designer can't handle this issue for preview but assume there is still a way to use WindowBuilder Editor in Design mode to create each Panel.
I'm guessing creating a GWT module or library might be the solution.
What is the best practices to use GWT Designer for this without resorting to a complete dynamic page as I have other non-GWT on the html page I would like to keep that way.
A simple example would be appreciated (I have not found any during my searching).
Posts: 1
Joined: Tue Nov 23, 2010 5:17 pm
Location: Boulder, CO, USA

Re: Multiple root panels - Howto

Postby Eric Clayberg » Tue Nov 30, 2010 5:35 am

techphd wrote:What is the correct way to use GWT Designer to create multiple panels that will be loaded into one web page.

You should design separate panels (each should be a separate class) for each part of the HTML page and then manually create an EntryPoint class which adds these panels to the required places.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
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 2 guests