1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    vivanov is on a distinguished road

      0  

    Default HBoxLayout isn't resizng content if it palased in TableLayout

    HBoxLayout isn't resizng content if it palased in TableLayout


    Hello.
    I have LayoutContainer with HBoxLayout which placed into LayoutContainer with a TableLayout.
    When I resize browser window, TableLayout and HBoxLayout are resizing, but content of HBoxLayout does not do it.
    Code:
    package com.mySampleApplication.client;
    import com.extjs.gxt.ui.client.GXT;
    import com.extjs.gxt.ui.client.util.Margins;
    import com.extjs.gxt.ui.client.util.Theme;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    import com.extjs.gxt.ui.client.widget.Viewport;
    import com.extjs.gxt.ui.client.widget.layout.*;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.TextBox;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>
     */
    public class MySampleApplication implements EntryPoint {
        private Viewport viewport;
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
            GXT.setDefaultTheme(Theme.GRAY, true);
            viewport = new Viewport();
            viewport.setLayout(new FlowLayout());
            TableLayout tableLayout =  new TableLayout(2);
            tableLayout.setBorder(2);
            LayoutContainer panel = new LayoutContainer(tableLayout);
            TextBox textBox;
            HBoxLayout hBoxLayout;
            HBoxLayoutData hBoxLayoutData;
            TableData tableData;
            // Adding two TextBoxes to first row in to each Column
            textBox = new TextBox();
            textBox.setWidth("100%");
            tableData = new TableData("100%", "24px");
            panel.add(textBox, tableData);
            textBox = new TextBox();
            textBox.setWidth("100%");
            tableData = new TableData("100%", "24px");
            panel.add(textBox, tableData);
            // Creating HBoxLayout
            LayoutContainer hContainer = new LayoutContainer();
            hBoxLayout = new HBoxLayout();
            hBoxLayout.setHBoxLayoutAlign(HBoxLayout.HBoxLayoutAlign.MIDDLE);
            hContainer.setLayout(hBoxLayout);
            textBox = new TextBox();
            hBoxLayoutData = new HBoxLayoutData(new Margins(0, 5, 0, 5));
            hBoxLayoutData.setFlex(1);
            hContainer.add(textBox, hBoxLayoutData);
            textBox = new TextBox();
            hBoxLayoutData = new HBoxLayoutData(new Margins(0, 5, 0, 5));
            hBoxLayoutData.setFlex(2);
            hContainer.add(textBox, hBoxLayoutData);
            tableData = new TableData("Auto", "100%");
            tableData.setColspan(2);
            hContainer.setHeight("24");
            panel.add(hContainer, tableData);
            viewport.add(panel);
            RootPanel.get().add(viewport);
        }
    }

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,754
    Vote Rating
    113
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    TableLayout is not resizing its children. This means that your container with your HBoxLayout is also not resized and so also does not resize its children.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    vivanov is on a distinguished road

      0  

    Default


    Thanks.