Results 1 to 9 of 9

Thread: BorderLayout not showing the collapse button correctly

  1. #1

    Default BorderLayout not showing the collapse button correctly

    I have a simple bit of code:

    Code:
    package test.client;
    
    import com.extjs.gxt.ui.client.Style.LayoutRegion;
    import com.extjs.gxt.ui.client.util.Margins;
    import com.extjs.gxt.ui.client.widget.ContentPanel;
    import com.extjs.gxt.ui.client.widget.Viewport;
    import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
    import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    
    public class Test implements EntryPoint {
      public void onModuleLoad() {
        Viewport v = new Viewport();
        v.setLayout(new BorderLayout());
    
        ContentPanel west = new ContentPanel();
    
        BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
        westData.setMargins(new Margins(5));
        westData.setCollapsible(true);
        v.add(west, westData);
    
        west.setHeading("West");
    
        ContentPanel centre = new ContentPanel();
        BorderLayoutData centreData = new BorderLayoutData(LayoutRegion.CENTER);
        v.add(centre, centreData);
    
        centre.setHeading("Centre");
    
        RootPanel.get().add(v);
      }
    }
    Please see the attached image for the result under FF3, the little arrow thing which is supposed to be on the same line with "West" and at the right is now on a separate line above the text. I don't have safari/IE/FF2 at hand so can't test it on other browsers. Any help is appreciated.

    GXT: 1.1
    GWT: 1.5.2
    Browser: Mozilla firefox 3.0.3

    Thanks

    Joe
    Attached Images Attached Images

  2. #2

    Default

    More information: I've just tested it under a webkit based browser (midori to be precise), it rendered correctly.

    A gecko problem by the look of things?

  3. #3

    Default

    Turned out it isn't just BorderLayout, AccordionLayout is affected as well, please compare the 2 image attached. Exact same file, rendered by gecko (the faulty one) and webkit.
    Attached Images Attached Images

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

    Default

    I don't believe browsers on Linux are supported - see http://extjs.com/products/gxt/

  5. #5

    Default

    It's has nothing to do with OS, it's the underlying layout engine.

    Attached is a side by side view of the page rendered by Firefox 3.0.3 and Safari 3.1.2 under Leopard.
    Attached Images Attached Images

  6. #6

    Default

    Hi,

    I tried your sample code in Windows in FF 3.0.3 and it renders correctly.

    --Ville

  7. #7

    Default

    I found the problem.

    I was using a 1.6VM for the compilation, and somehow it emits code firefox doesn't like, switching to a 1.5VM solved the problem.

    Thanks for the help guys.

  8. #8
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572

    Default

    I'm surprised, as I can't see how the VM choice impacts the GWT compiler considering it basically is not using the JVM compiler at all... it reads java source code and compiles to JS... the jvm bytecode version is hardly a factor.

    Personally, I'd stay on the 1.6 VM - all development is done on the 1.6VM and there are some bugs in generics in 1.5 that need to be avoided.

  9. #9

    Default

    I'm as baffled as you are, the only explanation I can think of is the GWT compiler bytecode is interpreted differently by the 1.5 and 1.6VM, i.e., implementation of certain API which the GWT compiler uses is different between 1.5 and 1.6, and thus causing the GWT compiler to producing inconsistent results.

    What I'm planning to do is: compile anything that needs to be compiled into java bytecode with a 1.6VM, only invoke the GWT compiler with a 1.5vm to produce the JS code.

Posting Permissions

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