Announcement

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

    Bug: 5.1d SectionStackSection setControls does not add items

    Hi Isomorphic,

    please see this builtInDS based testcase:

    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.layout.SectionStack;
    import com.smartgwt.client.widgets.layout.SectionStackSection;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS implements EntryPoint {
        private VLayout mainLayout;
        private IButton recreateBtn;
    
        private SectionStack ss;
        private SectionStackSection sss1;
        private IButton testBtn;
        private SectionStackSection sss2;
    
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
    
            mainLayout = new VLayout(20);
            mainLayout.setWidth100();
            mainLayout.setHeight100();
            
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    recreate();
                }
            });
            mainLayout.addMember(recreateBtn);
            recreate();
            mainLayout.draw();
        }
    
        private void recreate() {
            if (ss != null) {
                ss.markForDestroy();
                mainLayout.removeMember(ss);
            }
    
            ss = new SectionStack();
            ss.setHeight100();
            ss.setWidth100();
            sss1 = new SectionStackSection("Section 1");
            sss1.setName("SEC1");
            sss1.setExpanded(true);
            IButton x = new IButton("x");
            sss1.setItems(x);
    
            testBtn = new IButton("Test");
            sss1.setControls(testBtn);
    
            sss2 = new SectionStackSection("Section 2");
            sss2.setName("SEC2");
            IButton y = new IButton("y");
            sss2.setItems(y);
            ss.setSections(sss1, sss2);
            mainLayout.addMember(ss, 0);
        }
    }
    The 1st SectionStackSection does not show the controls from the setControls(testBtn)-call.

    I'm using SNAPSHOT_v10.1d_2015-09-14/PowerEdition Deployment. It worked as expected with v10.0p_2015-08-24.

    Best regards
    Blama

    #2
    Attached code because of forum's formatting bug.
    Attached Files

    Comment


      #3
      Testcase tested only in FF26 dev mode. In my application I have a similar setup using Layouts with more controls and a DynamicForm. The bug there exists for all browsers (GC45, FF26, IE11).

      Comment


        #4
        Thanks for your feedback, during a refactoring process we moved some code by mistake to the wrong place. It has been fixed now and you will find the patch applied in the next nightly build that will be released in a few hours.

        Comment


          #5
          This is working again using SNAPSHOT_v10.1d_2015-09-20/PowerEdition Deployment.

          Comment

          Working...
          X