Dojo Stack Container Startup hides the inner widgets

101 views Asked by At

Below is my code snippet, when I'm using dojo StackContainer, as soon as Stack container.startup is triggered, everything gets hidden except the title of the content panes. Please do let me know where I'm going wrong :

        var linkOamTp = new TitlePane({
            id:"linkOamTp",
            preventCache : false,
            open :true
        });
        registry.byId(containerWdg).addChild(linkOamTp);

        domConstruct.create("div",{id:"linkOamStackControllerDiv"},linkOamTp.containerNode);
        domConstruct.create("div",{id:"linkOamStackContainerDiv"},linkOamTp.containerNode);
        var linkOamSc = new StackContainer({
            style: "width: 100% !important; height: 98% !important",
            id: "linkOamStackContainer"
        },"linkOamStackContainerDiv");

        var cp1 = new ContentPane({
            title: "A-END",
            style : " width:100%; height: 100%; ",
            content : "content a"
        }); 
        linkOamSc.addChild(cp1);

        var cp2 = new ContentPane({
            title: "Z-END",
            style : " width:100%; height:100%; ",
            content : "content-b"
            });
        linkOamSc.addChild(cp2);

        var controller = new StackController({containerId: linkOamSc.id},"linkOamStackControllerDiv");
        linkOamSc.startup();
        controller.startup();
2

There are 2 answers

1
bajji On

Are you sure that 'linkOamSc.id' is actually returning "linkOamStackContainer"?

Generally, StackController is used in conjunction with StackContainer (which you have done) and StackController uses id of the StackContainer.

Try changing your code to

var controller = new StackController({containerId: "linkOamStackContainer"},"linkOamStackControllerDiv");
1
Prajwel On

Found a solution for this, I just called "linkOamSc.resize()"