1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    13
    Vote Rating
    0
    doud is on a distinguished road

      0  

    Default set FlowLayout margins

    set FlowLayout margins


    hi,

    I tried to set a margin between all the 3 FormPanels in
    GWT 1.5
    GXT 1.0.1
    hosted and browser mode

    with this code :

    Code:
    public class Test extends LayoutContainer implements EntryPoint {
    
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
    
            // layout
            FlowLayout layout = new FlowLayout(20);
            setLayout(layout);
                            
            ContentPanel form1 = new FormPanel();
            form1.setHeading("form1");
    
            ContentPanel form2 = new FormPanel();
            form2.setHeading("form2");
    
            ContentPanel form3 = new FormPanel();
            form3.setHeading("form3");
    
            TextField field1 = new TextField();
            field1.setFieldLabel("field");
            TextField field2 = new TextField();
            field2.setFieldLabel("field");
            TextField field3 = new TextField();
            field3.setFieldLabel("field");
    
            form1.add(field1);
            form1.setCollapsible(true);
            form1.setAnimCollapse(false);
            form2.add(field2);
            form2.setCollapsible(true);
            form2.setAnimCollapse(false);
            form3.add(field3);
            form3.setCollapsible(true);
            form3.setAnimCollapse(false);
            
            add(form1);
            add(form2);
            add(form3);
            
            RootPanel.get().add(this);
        }
    }
    I also tried
    Code:
    layout.setMargin(20);
    and
    Code:
    add(form1, new FlowData(20);
    with no more luck.

    all my FormPanel are stick together with no spacing

  2. #2
    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  

    Default


    try

    Code:
    add(form1, new MarginData(20));
    Last edited by gslender; 20 Jul 2008 at 2:32 PM. Reason: missing close brackett

  3. #3
    Ext User
    Join Date
    Jul 2008
    Posts
    13
    Vote Rating
    0
    doud is on a distinguished road

      0  

    Default


    Quote Originally Posted by gslender View Post
    try

    Code:
    add(form1, new MarginData(20));
    I tried, nothing changed

    ps: I'm on linux

  4. #4
    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  

    Default


    This...
    Code:
    		        add(form1,new MarginData(10));
    		        add(form2,new MarginData(20));
    		        add(form3,new MarginData(30));
    produced this on WinXP ie6 and FF3

    ps - I also removed the 20 out of new FlowLayout(20) - not that this impacted the render
    Attached Images

  5. #5
    Ext User
    Join Date
    Jul 2008
    Posts
    13
    Vote Rating
    0
    doud is on a distinguished road

      0  

    Default


    produced this on Ubuntu 8.04 Hosted mode and FF3
    Attached Images

  6. #6
    Ext User
    Join Date
    Jul 2008
    Posts
    13
    Vote Rating
    0
    doud is on a distinguished road

      0  

    Default


    I tested against
    GWT 1.5
    GXT 1.0
    on Win 2003

    hosted mode : work
    ie6 : work
    firefox 3 : don't work ...

    same thing with GXT 1.0.1

  7. #7
    Ext User
    Join Date
    Apr 2008
    Posts
    376
    Vote Rating
    0
    zaccret is on a distinguished road

      0  

    Default


    Mmm, it seems that we still have some differences between browsers/OS. Darell, wouldn't it be helpful to declare the HTML 4 doctype instead of HTML 3 ? Look at http://extjs.com/forum/showthread.php?t=38334

  8. #8
    Ext User
    Join Date
    Jul 2008
    Posts
    13
    Vote Rating
    0
    doud is on a distinguished road

      0  

    Default


    Thank zaccret and gslender for your help.
    wrong doctype... I apologize
    I think I will write my own applicationCreator for gxt.

  9. #9
    Ext User
    Join Date
    Apr 2008
    Posts
    376
    Vote Rating
    0
    zaccret is on a distinguished road

      0  

    Default


    That's not a bad idea. Actually, it would be nice if Darell could integrate it in gxt bundle.

  10. #10
    Ext User
    Join Date
    Apr 2008
    Posts
    376
    Vote Rating
    0
    zaccret is on a distinguished road

      0  

    Default


    Did you write your applicationCreator, doud ?

Thread Participants: 2