Stan Kurilin
Stan Kurilin

Reputation: 15792

DockLayoutPanel doesn't work properly

I describe my panel in next way

<!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'>
<g:DockLayoutPanel unit="PX" width="600" >
    <g:north size="85">
    ....
    </g:north>
    <g:center>
    ....

    </g:center>
</g:DockLayoutPanel>

GWT generated for north and center next divs.

 <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 85px;"
 <div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">

They contains data that what I need, but second div doesn't displayed. Where I am wrong?

UPD: Just for example, for

    <g:center>
        <g:FlowPanel height="100%">
            <g:Label height="100%">TEST2</g:Label>
        </g:FlowPanel>
    </g:center>

I get

<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 85px; right: 0px; bottom: 0px;">
    <div style="height: 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
        <div class="gwt-Label" style="height: 100%;">TEST2</div>
    </div>
</div>
</div>

Upvotes: 3

Views: 2952

Answers (3)

Oleg Novosad
Oleg Novosad

Reputation: 2421

I have fixed this next way:

<ui:style>
    .visible {
        overflow: visible !important;
    }
</ui:style>

<g:DockLayoutPanel unit="PX" width="100%" height="100%">
    <g:north size="46" styleName="{style.visible}">
         ...
    </g:north>
</g:DockLayoutPanel>

Upvotes: 1

ngspkinga
ngspkinga

Reputation: 411

I think I know what you did wrong. You need this:

RootLayoutPanel().get().add(new MyView());

instead of:

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

Because if you use uibinder you need the RootLayouPanel!

I hope it will help you!

Upvotes: 9

ngspkinga
ngspkinga

Reputation: 411

Edit: The important thing is, what is in the center widget. Example FlowPanel will fill out the area, but VerticalPanel not. Then you have to set the height property 100%.

Upvotes: 0

Related Questions