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

      0  

    Question [CLOSED] Differences between Hosted mode and Web Mode

    [CLOSED] Differences between Hosted mode and Web Mode


    Hi,

    Sometimes, I have differences between web mode and hosted mode. Well I feel it looks like a GWT bug, but GXT code will probably not help GWT team. What can I do ? Here is the code :

    Code:
    public void onModuleLoad(){
            Viewport viewport = new Viewport();
            viewport.setLayout(new BorderLayout());
    
            BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
            centerData.margins = new Margins(0, 0, 5, 0);
            ContentPanel mainPanel = new ContentPanel();
    
            BorderLayoutData mainCenter = new BorderLayoutData(Style.LayoutRegion.CENTER);
            mainCenter.margins = new Margins(0, 5, 5, 5);
            viewport.add(mainPanel, mainCenter);
        
            ToolBar topPanel = new ToolBar();
            
            final Menu menu1 = new Menu();
            menu1.add(new Item("This is a long long item text"));
            menu1.add(new Item("Show all files"));
            TextToolItem tool1 = new TextToolItem("File");
            tool1.setMenu(menu1);
            topPanel.add(tool1);
            
            BorderLayoutData northData = new BorderLayoutData(Style.LayoutRegion.NORTH,15);
            viewport.add(topPanel, northData);
            
            ContentPanel west = new ContentPanel();
            west.setHeading("My application");
            
            BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 350);
            viewport.add(west, westData);
            
            RootPanel.get().add(viewport);
        }
    The differences :
    - the toolbar height : good looking in hosted mode, but I think more than 15 pixel height. 15 pixel height in web mode. As a workaround, I can set 25 pixel height and it's ok for both.
    - the menu width : ok in hosted mode, not ok in web mode (text overflow)
    - the margins

    I have also noticed some differences in these threads :
    http://extjs.com/forum/showthread.php?t=35695
    http://extjs.com/forum/showthread.php?t=35575

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    You code was a little off. Try this code with beta 3. It works in both web and host mode.

    Code:
      public void onModuleLoad() {
        Viewport viewport = new Viewport();
        viewport.setLayout(new BorderLayout());
    
        ContentPanel mainPanel = new ContentPanel();
    
        BorderLayoutData mainCenter = new BorderLayoutData(Style.LayoutRegion.CENTER);
        mainCenter.setMargins(new Margins(0, 5, 5, 5));
        viewport.add(mainPanel, mainCenter);
    
        ToolBar topPanel = new ToolBar();
    
        final Menu menu1 = new Menu();
        menu1.add(new Item("This is a long long item text"));
        menu1.add(new Item("Show all files"));
        TextToolItem tool1 = new TextToolItem("File");
        tool1.setMenu(menu1);
        topPanel.add(tool1);
    
        BorderLayoutData northData = new BorderLayoutData(Style.LayoutRegion.NORTH, 30);
        northData.setMargins(new Margins(5));
        viewport.add(topPanel, northData);
    
        ContentPanel west = new ContentPanel();
        west.setHeading("My application");
    
        BorderLayoutData westData = new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 350);
        westData.setMargins(new Margins(0, 0, 5, 5));
        viewport.add(west, westData);
    
        RootPanel.get().add(viewport);
      }
    I am closing the bug, if you still have problems you can reply to this post.

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

      0  

    Default


    Hi Darell. Great! It works and, most importantly, we have the same behaviour in hosted mode and web mode, at least with IE6 (the behaviour is slightly different in Firefox 3 beta 5).

    Thanks again for your work, I really think you are making a great product. By the way, we are about to purchase a licence + support
    Last edited by zaccret; 21 May 2008 at 11:34 PM. Reason: IE7 -> IE6

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

      0  

    Default


    Actually, I work on Windows so my hosted mode is using IE core. The differences are not really between web and hosted mode but between IE6 and Firefox (FF2 and FF3).
    Last edited by zaccret; 21 May 2008 at 11:34 PM. Reason: IE -> IE6

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

      0  

    Default


    I've postponed the remaining margins/height issue in a new thread : http://extjs.com/forum/showthread.php?p=172228

Thread Participants: 1