May I use DockLayoutPanel in DialogBox in GWT

230 Views Asked by At

I' m tying to make a dialog box that contains 3 parts: TextBox, DataGrid and Button. And I'm using DockLayoutPanel like that

<ui:style>
    .panel {
        width: 600px;
        height: 500px;
    }
</ui:style>

<g:HTMLPanel addStyleNames='{style.panel}'>
    <g:DockLayoutPanel unit="PX">
       <g:north size="45">
          <g:TextBox>...
       </g:north>
       <g:south size="45">
          <g:Button>...
       </g:south>
       <g:center>
          <g:DataGrid>...
       </g:center>
    </g:DockLayoutPanel>
</g:HTMLPanel>

Here is my class

public class MyDialogBoxViewImpl extends DialogBox {
 interface MyDialogBoxViewImplUiBinder extends
    UiBinder<Widget, MyDialogBoxViewImpl> {
    }
...

But the problem is that only TextBox is visible. I'm not sure that it is properly to use DockLayoutPanel in DialogBox, but it is so suitable for my application. So can you help me with my issue and give me some advices how to replace DockLayoutPanel if it will need. Thanks.

2

There are 2 best solutions below

0
On BEST ANSWER

Try setting explicitly the size of DockLayoutPanel. For example:

<g:DockLayoutPanel unit="PX" width="100%" height="100%">
0
On

Your size values are "100%", but your unit is "PX". Try changing your unit to "PCT" for percentage width and height