1. #1
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    4
    gslender is on a distinguished road

      0  

    Exclamation [FIXED] B4 RowLayout #2 bug

    [FIXED] B4 RowLayout #2 bug


    Hi,

    I think this is a similar issue to the other rowlayout bug posted (http://extjs.com/forum/showthread.php?t=37181)

    This snippet shows the problem in another way... odd how it effects another layout ??

    Seen in hosted mode and FF2

    Note the bottom region is rendering below the window... some margin information is lost. If you remove the rowlayout (set against the viewport) everything renders fine (after some code changes to ensure the tabpanel is shown).

    Code:
        public void onModuleLoad() {
            
            final Viewport viewport = new Viewport();
            viewport.setStyleName("my-border-layout");
            
            viewport.setLayout(new RowLayout());
            
             //// TOP HEADER ////
            HorizontalPanel header = new HorizontalPanel();
            header.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
            Image img = new Image("logo.gif");
            header.add(img);
            Label lbl = new Label("tag line");
            lbl.setWordWrap(false);
            header.add(lbl);
            Label space = new Label(" ");
            new El(space.getElement()).setVisibility(false);
            header.add(space);
            header.setCellWidth(space, "100%");
            header.add(new ThemeSelector());
            header.setSpacing(5);
            
            
            LayoutContainer main = new LayoutContainer();
            main.setLayout(new BorderLayout());
    
            //// MAIN CENTER PANEL ////
            final ContentPanel centerPanel = new ContentPanel();
            centerPanel.setHeaderVisible(true);
            centerPanel.setLayout(new FillLayout());
            centerPanel.setHeading("title");
            Button test = new Button("click me");   
            
            
            centerPanel.getHeader().addTool(test);
            BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
            main.add(centerPanel, centerData);        
    
            
            viewport.add(header, new RowData(1,-1));
            viewport.add(main, new RowData(1,1));    
            final TabPanel mainTabPanel = new TabPanel();
            centerPanel.add(mainTabPanel );    
            
            RootPanel.get().add(viewport);
            
            SelectionListener listener = new SelectionListener() 
            {
                public void componentSelected(ComponentEvent be) 
                {
                     DeferredCommand.addCommand(new Command() 
                        {
                            public void execute() 
                            {         
                                TabItem welcomeTab = new TabItem();   
                                welcomeTab.setText("Welcome");   
                                welcomeTab.addText("Tab Body ");
                                mainTabPanel.add(welcomeTab);
                                TabItem test = new TestTab();        
                                mainTabPanel.add(test);
                                
                                mainTabPanel.setSelection(test);   
    //                            mainTabPanel.focus();    
                                
                            }
                        });
                }
            };  
            test.addSelectionListener(listener);
    
           }           
               
        public class TestTab extends TabItem 
        {    
            public TestTab() {
                super();
                   setText("Test");
                   
                   setLayout(new RowLayout(Orientation.VERTICAL));
    
                   LayoutContainer lowercontainer = new LayoutContainer();
                   add(lowercontainer,new RowData(1,1));
                       
                   lowercontainer.setLayout(new BorderLayout());
                   
                   ContentPanel cp1 = new ContentPanel();
                   cp1.setHeading("Summary");
                   cp1.setLayout(new FillLayout());
                   BorderLayoutData bld = new BorderLayoutData(LayoutRegion.WEST,300);
                   bld.setMargins(new Margins(10,0,0,10));
                   lowercontainer.add(cp1,bld);
                   
                   ContentPanel cp2 = new ContentPanel();
                   cp2.setHeading("Details");
                   cp2.setLayout(new FillLayout());
                   bld = new BorderLayoutData(LayoutRegion.CENTER);
                   bld.setMargins(new Margins(10,10,0,10));
                   lowercontainer.add(cp2,bld);
                   
                   ContentPanel cp3 = new ContentPanel(); 
                   cp3.setHeading("Overview");
                   bld = new BorderLayoutData(LayoutRegion.SOUTH,200);
                   bld.setMargins(new Margins(10,10,10,10));
                   bld.setCollapsible(true);
                   lowercontainer.add(cp3,bld);
               }
        }

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    There was a bug that has been fixed in SVN. However, you need to call viewport.layout() in your button listener:
    Code:
            DeferredCommand.addCommand(new Command() {
              public void execute() {
                TabItem welcomeTab = new TabItem();
                welcomeTab.setText("Welcome");
                welcomeTab.addText("Tab Body ");
                mainTabPanel.add(welcomeTab);
                TabItem test = new TestTab();
                mainTabPanel.add(test);
    
                mainTabPanel.setSelection(test);
                viewport.layout();
              }
            });

Thread Participants: 1