DockLayoutPanel can not show center element using uibinder

438 views
Skip to first unread message

Shelley

unread,
Nov 10, 2010, 3:06:14 AM11/10/10
to Google Web Toolkit
hello all:
below is a super simple app, which demonstrate the use of uibinder, so
strange that after lanching the app, i can only see the top part of
docklayoutpanel, nothing shows in the below part!
is there anything wrong? please help me out, thanks very much.

public class KeyProviderExample implements EntryPoint
{
public void onModuleLoad()
{
RootPanel.get().add( new ExpensesShell() );
}
}

public class ExpensesShell extends Composite
{
interface ShellUiBinder extends UiBinder<Widget, ExpensesShell>
{
}

private static ShellUiBinder uiBinder =
GWT.create( ShellUiBinder.class );

public ExpensesShell()
{
initWidget( uiBinder.createAndBindUi( this ) );
}
}



<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:e='urn:import:com.history.client'>


<g:DockLayoutPanel unit='PX'>
<g:north size='50'>
<g:HTMLPanel>abc</g:HTMLPanel>
</g:north>
<g:center>
<g:HTMLPanel>def</g:HTMLPanel>
</g:center>
</g:DockLayoutPanel>
</ui:UiBinder>

zixzigma

unread,
Nov 10, 2010, 9:57:30 AM11/10/10
to Google Web Toolkit
i think, in your onModuleLoad method,

RootPanel.get().add( new ExpensesShell() );

change RootPanel to RootLayoutPanel.

please report back if it works.
thank you

Shelley

unread,
Nov 10, 2010, 9:55:08 PM11/10/10
to Google Web Toolkit
Yes! it works! i considered everything but the RootLayoutPanel. thanks
very much.

Plutarco

unread,
Nov 10, 2010, 2:40:28 PM11/10/10
to Google Web Toolkit
I have the same issue:

<g:DockLayoutPanel unit='EM' ui:field='dockLayout'>
<g:north size='5'>
<g:Label>Top</g:Label>
</g:north>
<g:center>
<g:Label>Body</g:Label>
</g:center>
<g:west size='10'>
<g:HTML>
<ul>
<li>Sidebar</li>
<li>Sidebar</li>
<li>Sidebar</li>
</ul>
</g:HTML>
</g:west>
</g:DockLayoutPanel>

I can´t see Body and Sidebar. After check my source-html if a remove
overflow:hidden its works!..
How can I change this property?

Yes, Im using RootLayoutPanel.

thank you

Steve Moyer

unread,
Nov 24, 2010, 9:21:44 PM11/24/10
to Google Web Toolkit
Have you declared that you want "standards mode" in the DOCTYPE of the
host HTML page? I also vaguely remember having better success when
the center panel was the last thing added (but perhaps this was before
Uibinder). In any case, I've gotten into the habit of always putting
the center panel last.

smoyer

zixzigma

unread,
Nov 25, 2010, 3:22:10 AM11/25/10
to Google Web Toolkit
make sure you include height="100%"


<g:DockLayoutPanel height="100%">

Reply all
Reply to author
Forward
0 new messages