Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bizarre layout issues on repeated opens in nightly 285

    We picked up the latest nightly and started seeing a lot of bizarre layout with code that worked fine in earlier builds (252 is the last confirmed good one I'm aware of).

    We've seen it with modal windows - the first time opening works fine. But subsequent opens either don't open the window at all or the window opens but controls are missing or placed in strange places.

    We've also seen it with section stack controls.

    Here is a sample that illustrates the problem. Click the "load" button to create a second "Dictionary" tab with a series of section stack panels. This works fine the first time. Close the tab and click "load" again. A series of section stacks are created - but some seem to missing. And the content inside the stack section is often placed somewhere else. Repeating the close/load cycle shows that things get progressively worse.

    Code:
    public class SmartTest implements EntryPoint
    {
        private Button button = new Button("load");
        private TabSet set = new TabSet();
    
        public void onModuleLoad()
        {
            final VLayout vLayout = new VLayout();
            vLayout.setWidth100();
            vLayout.setHeight100();
    
            SC.showConsole();
    
            Tab mainTab = new Tab("Main");
            mainTab.setCanClose(false);
    
            VLayout mTabLayout = new VLayout();
            mTabLayout.setHeight100();
            mTabLayout.setWidth100();
    
            Label mTabLabel = new Label("Testing");
            mTabLayout.addMember(mTabLabel);
    
            mainTab.setPane(mTabLayout);
    
            set.addTab(mainTab);
    
            button.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event)
                {
                    buildDictionary();
                }
            });
    
            vLayout.addMember(set);
            vLayout.addMember(button);
            vLayout.draw();
        }
    
        protected void buildDictionary()
        {
            final HLayout hLayout = new HLayout();
            hLayout.setHeight100();
            hLayout.setWidth100();
    
            for (int i = 0; i < 5; i++)
            {
                SmartGridPanel cPanel = new SmartGridPanel("Panel " + i);
                hLayout.addMember(cPanel);
            }
    
            Tab dictTab = new Tab("Dictionary");
            dictTab.setCanClose(true);
            dictTab.setPane(hLayout);
    
            set.addTab(dictTab);
            set.selectTab(dictTab);
        }
    
        private class SmartGridPanel extends SectionStack
        {
            private VLayout vLayout = new VLayout();
            private SectionStackSection section = new SectionStackSection();
    
            public SmartGridPanel(String category)
            {
                vLayout.setHeight100();
                vLayout.setWidth100();
    
                this.setHeight100();
                this.setWidth100();
    
                section.setTitle(category);
                section.setCanCollapse(false);
    
                Label label = new Label(category);
                vLayout.addMember(label);
                section.addItem(vLayout);
                this.addSection(section);
            }
        }
    }

    #2
    Thanks for the testcase. We're looking into it.

    Comment


      #3
      Dear,

      I've a similar issue with some page....

      First I was thinking of a bug, but with this post, it may not.

      I have a VLayout page with a SectionStack and a TabSet (difficult to include the code, because it's very large).

      If I open this page (using addChild) on the first time (from my EntryPoint), it works fine :



      If I open this page after another one (loginPage for example, with a addChild then removeChild), then the layout is very very strange... :



      Best Regards

      Alexandre

      Comment


        #4
        Tom, Alexandre,
        Can you please try using the latest SVN build?

        Thanks,
        Sanjiv

        Comment


          #5
          Dear,

          It works for me, (but now a problem with printing, see 'Problem with printing' post).

          Thanks a lot.

          Alexandre

          Comment


            #6
            Good to hear. Will look into the print issue.

            Sanjiv

            Comment


              #7
              The new build seems to have fixed things for us too.

              Thanks!

              Comment

              Working...
              X