Results 1 to 3 of 3

Thread: Borderlayout size in Window broken

  1. #1

    Default Borderlayout size in Window broken

    This is GXT 1.1.1.

    1.1.2 has other bugs in BorderLayout with FitLayout, so I can't use that. Same result for that test, however.

    (By the way, this forum doesn't show the NEW THREAD button on Safari. I had to use Firefox to post this.)

    Code:
    public class TestWindow extends Window {
    
        public TestWindow() {
            super();
    
            setWidth(500);
            setHeight(500);
    
            setLayout(new FitLayout());
            add(
                    new LayoutContainer() {
                        protected void onRender(Element parent, int pos) {
                            super.onRender(parent, pos);
    
                            setLayout(new BorderLayout());
    
                            BorderLayoutData west = new BorderLayoutData(Style.LayoutRegion.WEST);
                            west.setSize(50);
                            west.setMinSize(50);
                            west.setMaxSize(50);
    
                            ContentPanel foo = new ContentPanel();
                            foo.setHeaderVisible(false);
                            foo.add(new Label("Foo"));
                            foo.setWidth(50); // FIX!
                            add(foo, west);
    
                            BorderLayoutData center = new BorderLayoutData(Style.LayoutRegion.CENTER);
                            ContentPanel bar = new ContentPanel();
                            bar.setHeaderVisible(false);
                            bar.add(new Label("Bar"));
                            add(bar, center);
                        }
                    }
            );
    
        }
    }
    The WEST panel Foo is not the right size (50) in hosted mode on OS X. It's also broken in compiled mode on OS X and the latest stable Safari. It is however correct on Firefox 3.0.3 on OS X.

    The FIX! line resolves the issue. If you remove that line, the WEST foo panel has a random size and any min/max sizes don't have any effect.

  2. #2

    Default

    This is an issue related to some state that is stored outside of the Window instance:

    1. new TestWindow().show() and you will see the wrong size of the Foo panel

    2. trigger a listener on the window that calls WindowManager.get().unregister(this); this.close(); when the CLOSE button is clicked (I have no idea why you can't properly close windows in GXT any other way and if this is the right way.)

    3. new TestWindow().show() and you will see the CORRECT size of the Foo panel

    So, there is some state involved that is not part of the Window instance. I'd look for a bug in WindowManager.

  3. #3

    Default

    Verified again (also for my latest reply) that the behavior I see in OS X hosted mode is the same as in Safari on OS X. Compiled code on Firefox 3.0.3 behaves correctly and shows the correct layout sizes even when the window is first instantiated.

Posting Permissions

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