Results 1 to 7 of 7

Thread: Reuse widgets between BorderLayoutContainer with split

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-3406 in 3.1.
  1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default Reuse widgets between BorderLayoutContainer with split

    Required Information


    Version(s) of Ext GWT
    Ext GWT 3.0.6


    Browser versions and OS
    (and desktop environment, if applicable)
    • Firefox 25, Windows 8.1
    • Chrome 31, Windows 8.1


    Virtual Machine
    No


    Description
    When you reuse widgets between BorderLayoutContainer instances and define the widgets to use a splitter, the splitter drag operation will result in lots of errors. For the user, this seems as if the splitter does not work.


    Run mode
    Both development and production mode


    Steps to reproduce the problem
    1. Start the provided example in your browser
    2. Start dragging using the splitter
    3. See that nothing happens


    Expected result
    That the size of the widgets are changed


    Actual result
    Nothing happens, lots of error messages


    Test case
    Code:
    public class MultipleBorderLayout implements EntryPoint {
    
    
        @Override
        public final void onModuleLoad() {
            final ContentPanel outerLeft = new ContentPanel();
            outerLeft.setHeadingText("Outer left");
    
    
            final BorderLayoutContainer outerContainer = new BorderLayoutContainer();
            outerContainer.setWestWidget(outerLeft, new BorderLayoutData(200) {
                {
                    this.setSplit(true);
                    this.setCollapsible(true);
                }
            });
    
    
            final Viewport viewport = new Viewport();
            viewport.add(outerContainer);
    
    
            RootPanel.get().add(viewport);
    
    
            final ContentPanel innerLeft = new ContentPanel();
            innerLeft.setHeadingText("Inner left");
    
    
            final ContentPanel center = new ContentPanel();
            center.setHeadingText("Center");
    
    
            final BorderLayoutContainer innerContainer = new BorderLayoutContainer();
            innerContainer.setWestWidget(innerLeft, new BorderLayoutData(200) {
                {
                    this.setSplit(true);
                    this.setCollapsible(true);
                    this.setMargins(new Margins(0, 0, 0, 5));
                }
            });
            innerContainer.setCenterWidget(center, new MarginData(0, 0, 0, 5));
            outerContainer.setCenterWidget(innerContainer);
    
    
            // innerLeft.setData("splitBar", null);
    
    
            final BorderLayoutContainer newContainer = new BorderLayoutContainer();
            newContainer.setWestWidget(innerLeft, new BorderLayoutData(200) {
                {
                    this.setSplit(true);
                    this.setCollapsible(true);
                    this.setMargins(new Margins(0, 0, 0, 5));
                }
            });
            newContainer.setCenterWidget(center, new MarginData(0, 0, 0, 5));
            outerContainer.setCenterWidget(newContainer);
        }
    }


    Temporary workaround
    Set data for splitBar to null before adding widget to new container. Uncomment the commented line in the provided example to see this.

  2. #2
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    In production mode this also happens occasionally for non-reused components. Resetting splitBar data will also work in these cases.

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

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  4. #4
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    Thanks for reporting. After investigating I noticed that the BLC wiring needs to have unique content panels set for the widgets for north, east, west, south and center widgets. Although there are a couple inconsistencies that exist when replacing a widget and we have fixes going in shortly regarding layout data not getting reset and a fix for the collapsible tool button. This has helped add a fix a duplication of the collapsible tool button.

    In other words the content panels in the BLC can't be reused with out issue, so creating a new content panel is the way to go.

    Code:
    public class BorderLayoutContainerSplitTest implements EntryPoint {
    
    
      private BorderLayoutContainer borderLayoutContainer;
    
    
      @Override
      public final void onModuleLoad() {
        final ContentPanel outerLeft = new ContentPanel();
        outerLeft.setHeadingText("Outer left");
    
    
        borderLayoutContainer = new BorderLayoutContainer();
        borderLayoutContainer.setWestWidget(outerLeft, getLayoutDataOuter());
        borderLayoutContainer.setCenterWidget(getCenterContainer1());
        borderLayoutContainer.setCenterWidget(getCenterContainer2());
    
    
        final Viewport viewport = new Viewport();
        viewport.add(borderLayoutContainer);
        RootPanel.get().add(viewport);
      }
    
    
      private IsWidget getCenterContainer1() {
        ContentPanel centerInner = new ContentPanel();
        centerInner.setHeadingText("Inner Center 1");
    
    
        ContentPanel leftInner = new ContentPanel();
        leftInner.setHeadingText("Inner left 1");
    
    
        final BorderLayoutContainer blc = new BorderLayoutContainer();
        blc.setWestWidget(leftInner, getLayoutDataCenter());
        blc.setCenterWidget(centerInner, new MarginData(0, 0, 0, 5));
    
    
        SimpleContainer container = new SimpleContainer();
        container.add(blc);
    
    
        return container;
      }
    
    
      private BorderLayoutContainer getCenterContainer2() {
        ContentPanel centerInner = new ContentPanel();
        centerInner.setHeadingText("Inner Center 2");
    
    
        ContentPanel leftInner = new ContentPanel();
        leftInner.setHeadingText("Inner left 2");
    
    
        BorderLayoutContainer blc = new BorderLayoutContainer();
        blc.setWestWidget(leftInner, getLayoutDataCenter());
        blc.setCenterWidget(centerInner, new MarginData(0, 0, 0, 5));
    
    
        return blc;
      }
    
    
      public BorderLayoutData getLayoutDataOuter() {
        BorderLayoutData layoutData = new BorderLayoutData(200);
        layoutData.setSplit(true);
        layoutData.setCollapsible(true);
    
    
        return layoutData;
      }
    
    
      private BorderLayoutData getLayoutDataCenter() {
        BorderLayoutData layoutData = new BorderLayoutData(200);
        layoutData.setSplit(true);
        layoutData.setCollapsible(true);
        layoutData.setMargins(new Margins(0, 0, 0, 5));
    
    
        return layoutData;
      }
    
    
    }
    Brandon

  5. #5
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    This issue has been fixed and will be available in the 3.1.0 release shortly.

    Brandon

  6. #6
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    I tested this against GXT 3.1, and the problem still occurs

  7. #7
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    I'm investigating and will get back shortly.

Posting Permissions

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