1. #1
    Ext GWT Premium Member
    Join Date
    May 2008
    Posts
    11
    Vote Rating
    0
    Speedbird is on a distinguished road

      0  

    Default Layout Destroyed in Hosted Mode

    Layout Destroyed in Hosted Mode


    Hi,

    I have a mysterious problem: I updated from GWT 1.5 RC1 to the first release of GWT 1.5 (1.5.2) and without any changes of the code of my application, the hosted mode browser of GWT shows a destroyed layout inside a window. If I compile the application and run it by any external browser, it works fine.

    The window contains two contentpanels ordered by borderlayout. The first one is placed in layoutregion west, the other one in layoutregion center. The have to appear side by side. In hosted mode the second panel is placed under the first one.

    Here is the sample Code:
    Code:
    public class WindowTest extends ContentPanel implements EntryPoint {
     
     private Window internalWindow;
     private TabPanel tabPanel;
     private ContentPanel treePanel;
     public void onModuleLoad() {
      Viewport viewport = new Viewport();
      viewport.setLayout(new BorderLayout());
      viewport.add(this);
      RootPanel.get().add(viewport);
      getInternalWindow().show();
     }
     
     public WindowTest() {
      super();
      setFrame(true);
      setBorders(true);
      setHeaderVisible(true);
      setHeading("TestApp");
      setLayout(new FitLayout());
      BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
      data.setMargins(new Margins(5, 5, 5, 0));
      setLayoutData(data); 
     }
     public Window getInternalWindow() {
      if (internalWindow == null) {
       internalWindow = new InternalWindow();
       internalWindow.setLayoutOnChange(true);
      }
      return internalWindow;
     }
     TabPanel getTabPanel() {
      if (tabPanel == null) {
       tabPanel = new TabPanel();
       tabPanel.add(new TabItem("Test1"));  
       tabPanel.add(new TabItem("Test2"));    }
      return tabPanel;
     }
     ContentPanel getTreePanel() {
      if (treePanel == null) {
       treePanel = new ContentPanel();
       treePanel.setHeaderVisible(false);
      }
      return treePanel;
     }
     
     private class InternalWindow extends Window {
      public InternalWindow() {
       super();
       setMinimizable(true);
       setMaximizable(true);
       setLayoutOnChange(true);
       setLayout(new BorderLayout());
       setHeight(400);
       setInitialWidth(540);
       setBorders(true);
       setHeaderVisible(true);
       setHeading("Test");
       ContentPanel pnlData = createRightPanel();
       BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST);
       westData.setSplit(true);
       westData.setMargins(new Margins(5, 5, 5, 0));
       BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
       centerData.setMargins(new Margins(5, 0, 5, 0));
       add(getTreePanel(), westData);
       add(pnlData, centerData);
      }
      protected void onRender(Element parent, int pos) {
       super.onRender(parent, pos);
      }
      private ContentPanel createRightPanel() {
       ContentPanel rightPanel = new ContentPanel();
       rightPanel.setLayout(new FillLayout());
       rightPanel.setHeaderVisible(false);
       rightPanel.setAutoWidth(true);
       LayoutContainer infoBar = createInfoBar();
       infoBar.layout();
       rightPanel.setTopComponent(infoBar);
       rightPanel.add(getTabPanel());
       LayoutContainer statusBar = new LayoutContainer();
       TableRowLayout layoutBottom = new TableRowLayout();
       statusBar.setLayout(layoutBottom);
       statusBar.add(createStatusField("Value 1:")); 
       statusBar.add(createStatusField("Value 2")); 
       statusBar.add(createStatusField("Value 3")); 
       statusBar.add(createStatusField("Value 4")); 
       statusBar.add(createStatusField("Value 5")); 
       statusBar.add(createStatusField("Value 6"));
       statusBar.layout();
       rightPanel.setBottomComponent(statusBar);
       rightPanel.layout();
       return rightPanel;
      }
     
      TabPanel getTabPanel() {
       if (tabPanel == null) {
        tabPanel = new TabPanel();
        tabPanel.add(new TabItem("Test1"));
        tabPanel.add(new TabItem("Test2"));
       }
       return tabPanel;
      }
     
      private LayoutContainer createInfoBar() {
       LayoutContainer infoBar = new LayoutContainer();
       TableRowLayout layoutTop = new TableRowLayout();
       layoutTop.setInsertSpacer(true);
       infoBar.setLayout(layoutTop);
       Label lblInfo = new Label("Info:"); //$NON-NLS-1$
       TextField tfInfo = new TextField();
       tfInfo.setEnabled(false);
       tfInfo.setValue("Infotext"); //$NON-NLS-1$
       infoBar.add(lblInfo);
       infoBar.add(tfInfo);
       return infoBar;
      }
     
      private TextField createStatusField(String text) {
       TextField tfStat1 = new TextField();
       tfStat1.setEnabled(false);
       tfStat1.setWidth(100);
       tfStat1.setValue(text);
       return tfStat1;
      }
     
      ContentPanel getTreePanel() {
       if (treePanel == null) {
        treePanel = new ContentPanel();
        treePanel.setHeaderVisible(false);
       }
       return treePanel;
      }
     }
    }

  2. #2
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    davtrasher is on a distinguished road

      0  

    Default


    Same problem for me

  3. #3
    Ext User
    Join Date
    Apr 2008
    Location
    Lincoln, NE
    Posts
    235
    Vote Rating
    0
    jpnet is an unknown quantity at this point

      0  

    Default


    I had this exact same problem. The only thing that solves the problem was to update to the latest alpha build. I was using the Viewport by the way, not sure if you guys were as well.

    -JP

  4. #4
    Ext GWT Premium Member
    Join Date
    May 2008
    Posts
    11
    Vote Rating
    0
    Speedbird is on a distinguished road

      0  

Thread Participants: 2