Juri Strumpflohner
Juri Strumpflohner Juri is a full stack developer and tech lead with a special passion for the web and frontend development. He creates online videos for Egghead.io, writes articles on his blog and for tech magazines, speaks at conferences and holds training workshops. Juri is also a recognized Google Developer Expert in Web Technologies

DockLayoutPanel doesn't work correctly??

1 min read

Suppose you'd like to create a layout like the following using GWT:

With GWT 2.0 the documentation suggests to use the DockLayoutPanel.
<g:DockLayoutPanel unit='EM'>
<g:north size='4'>

<g:west size='16'>

<g:Label>Content Area</g:Label>

However pay attention, this won't work if you use the standard mechanism like
public void onModuleLoad() {
RootPanel.get("main").add(new MainUI());
where the new MainUI() contains the DockLayoutPanel as root element (I assume you're using GWT's new UiBinder mechanism), then the DockLayoutPanel won't work surprisingly.

Instead you have to use
public void onModuleLoad() {
RootLayoutPanel panel = RootLayoutPanel.get();
panel.add(new MainUI());

Questions? Thoughts? Hit me up on Twitter
comments powered by Disqus