Results 1 to 3 of 3

Thread: TabPanel Problem

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    27

    Default TabPanel Problem

    Hi,

    I have a widget with a toolbar, a grid and a pagingtoolbard. When I use this widget in a window all is OK but when i put this widget in a tabpanel (but not in the first tab) the widget in not correctly draw (see the attachment).
    When i move the mouse the toolbar and the gris appears correctly without the pagingtoolbar and why I maximize the window all the widget (toolbar, grid and pagingtoolbar) is correctly draw.

    An idea ? Thanks in advance,

    JB

    A part of the widget's code
    Code:
    VerticalLayoutContainer con = new VerticalLayoutContainer();
    con.add(t, new VerticalLayoutData(1,-1));con.add(grid, new VerticalLayoutData(1,1));
    con.add(pagToolBar, new VerticalLayoutData(1,-1));
    Img 1 : on load
    img1.jpg

    Img 2 : when I move the mouse
    img2.jpg
    Img 3 : when I maximize and restore the window
    img3.jpg

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default Found Bug in CardLayoutContainer

    I had a similar issue: forceLayout() on children of TabPanel was a noop, since isOrWasLayoutRunning() of parent returned false.
    Hier my bug report:

    Version(s) of Ext GWT
    Ext GWT 3.0.0b

    Browser versions and OS
    (and desktop environment, if applicable)
    Chrome and FF26.0 on Win7 64bit

    Virtual Machine
    No

    Description
    Layout broken on TabPanel. Initially chosen TabPanel is not affected.

    Run mode
    both

    Steps to reproduce the problem

    1. TabPanel with at least 2 tabs
    2. Click a Tab
    3. Check hadLayoutRunning of CardLayoutContainer by debugging



    Expected result
    Should be true, since this Tab is displayed and Layout had to be run.

    Actual result
    Is false, since only doLayout() has been called and not forceLayout().

    Debugging already done
    Code:
    public class CardLayoutContainer extends InsertResizeContainer implements HasActiveWidget {
    ...
      @Override
      public void setActiveWidget(Widget widget) {
        if (activeWidget == widget) {
          return;
        }
        if (activeWidget != null) {
          activeWidget.setVisible(false);
        }
        if (widget != null) {
          if (widget.asWidget().getParent() == this) {
            activeWidget = widget;
            activeWidget.setVisible(true);
            // forcing causes layout to execute every time this method called
            // when used with TabPanel this causes layouts to execute every time tab
            // selected which is not optimal
    
            // EXTGWT-1550, in example, a panel is collapsed then another tab is
            // selected. when returning to tab with collapsed panel
            // the layout executes as it was forced
    
            // layoutRequiredThisEventLoop = true;
            // forceLayout();
    
            if (GXT.isIE6() || GXT.isIE7()) {
              layoutRequiredThisEventLoop = true;
              forceLayout();
            } else {
              doLayout();
            }
    
          } else {
    ...
    Calling doLayout() instead of forceLayout() seems to be a bad idea:
    - doLayout() runs layout right away. This is usesless, if item is not attached/shown etc. forceLayout checks such things before eventually calling doLayout() itself!
    - forceLayout() eventually calls forceLayout() for children, doLayout() doesn't.
    - most important: forceLayout sets eventually hadLayoutRunning = true; doLayout() doesn't.

    Possible fix
    Obviously forceLayout() shall be called instead of doLayout().

  3. #3
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737

    Default

    GXT 3.0.0b is very old, 3.0.1 is the latest public, but this CardLayoutContainer bug was fixed in 3.0.3 as part of http://www.sencha.com/forum/showthread.php?230863 (and the related discussion http://www.sencha.com/forum/showthread.php?242957). These fixes will be made public in the upcoming 3.1 release, or you can get them now from support releases.

Posting Permissions

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