Question

I like DockLayoutPanel cos it's quite solid. However, there's a big problem.

That is how to remove a Block (West, East, North or South block) out of a DockLayoutPanel?

Let say, i got this code

   <g:DockLayoutPanel ui:field="centralDockLayoutPanel">
         <g:center>
               <g:LayoutPanel ui:field="mainPanel"/>  
         </g:center>
         <g:east size="200">
                <g:HTMLPanel ui:field="happyHTMLPanel"  width="100%" height="100%"> 
                 Some more widgets here
               </g:HTMLPanel> 
         </g:east>
   </g:DockLayoutPanel>  

I want to remove the East block out of the centralDockLayoutPanel. So i tried

getView().getCentralDockLayoutPanel().remove(getView().getHappyHTMLPanel());

But that doesn't work

getView().getHappyHTMLPanel().setVisible(false);

also doesn't work

Can we remove a Block (West, East, North or South block) out of a DockLayoutPanel?

Was it helpful?

Solution

You could try to do :

getView().getCentralDockLayoutPanel().remove(getView().getHappyHTMLPanel());
getView().getCentralDockLayoutPanel().forceLayout();

Or you can hide your panel:

getView().getCentralDockLayoutPanel().setWidgetHidden(getView().getHappyHTMLPanel(), true);
getView().getCentralDockLayoutPanel().forceLayout();

OTHER TIPS

I always make their size between zero and non-zero, representing hidden and display respectively. By that, you can even add some animations when changing the size of the children.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top