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: hidd开发者_如何学运维en; 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>
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!
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>
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%.
精彩评论