Results 1 to 3 of 3

Thread: Simple BorderLayout Example not working

  1. #1
    Ext User
    Join Date
    Feb 2009
    Posts
    2
    Vote Rating
    0
      0  

    Default Simple BorderLayout Example not working

    Below a simple BorderLayout example that is exhibiting a problem. If I collapse the South panel, I can't bring it back again. Moreover, if I collapse the north panel, the South panel disappears. Is there something wrong in my code or the GXT library has a bug?

    Thank you for your help.


    Code:
    public void onModuleLoad() {
    
            LayoutContainer lcontainer = new LayoutContainer();
            lcontainer.setLayout(new BorderLayout());   
            
            ContentPanel north = new ContentPanel();
            ContentPanel west = new ContentPanel();              
            ContentPanel center = new ContentPanel();
            ContentPanel east = new ContentPanel();
            ContentPanel south = new ContentPanel();
            
            north.setHeading("North");
            west.setHeading("West");
            center.setHeading("Center");
            east.setHeading("East");
            south.setHeading("South");
            
            BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 100);  
            northData.setCollapsible(true);  
            northData.setFloatable(true);  
            northData.setSplit(true);  
            northData.setMargins(new Margins(5, 5, 0, 5));  
            
            BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);  
            westData.setSplit(true);  
            westData.setCollapsible(true);  
            westData.setMargins(new Margins(5));  
            
            BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);  
            centerData.setMargins(new Margins(5, 0, 5, 0));  
            
            BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 200);  
            eastData.setSplit(true);  
            eastData.setCollapsible(true);  
            eastData.setMargins(new Margins(5));  
            
            BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 100);  
            southData.setSplit(true);  
            southData.setCollapsible(true);  
            southData.setFloatable(true);  
            southData.setMargins(new Margins(0, 5, 5, 5));  
            
            lcontainer.add(north, northData);  
            lcontainer.add(west, westData);  
            lcontainer.add(center, centerData);  
            lcontainer.add(east, eastData);  
            lcontainer.add(south, southData);
            
            RootPanel.get().add(lcontainer);
    }

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    4
      0  

    Default

    yes. you didn't size the layoutcontainer - setSize(800,600) would fix this

    ...or, add to viewport with fitlayout and it will resize with browser

  3. #3
    Ext User
    Join Date
    Feb 2009
    Posts
    2
    Vote Rating
    0
      0  

    Default Solved -- south panel problem

    That solved the problem. Now the south panel does not disappear.

    Thank you very much.




    Quote Originally Posted by gslender View Post
    yes. you didn't size the layoutcontainer - setSize(800,600) would fix this

    ...or, add to viewport with fitlayout and it will resize with browser

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •