embed multiple webparts

LabKey Support Forum (Inactive)
embed multiple webparts Maya Li  2012-01-05 11:03
Status: Closed
 
I have a simple piece of code that tries to embed two webparts. But it only embeds on and ignores the other. How do I get it to embed both of them?


<script type="text/javascript">
    
    var studyListWebPart = new LABKEY.QueryWebPart({
      partName: 'Maru Study List',
      renderTo: 'studyListDiv'
    });
   
    
    var messageWebPart = new LABKEY.WebPart({
        partName: "Messages",
        renderTo: 'mDiv'
    });
   
    Ext.onReady(function(){
         studyListWebPart.render();
         messageWebPart.render();
    });
</script>

<div id="main">
    <div id="mDiv"/>
    <div id="studyListDiv"/>
</div>
 
 
Ben Bimber responded:  2012-01-05 11:09
hi maya,

i believe you problem is the self-closing div tags (<div />), so i'd try:


    <div id="mDiv"></div>
    <div id="studyListDiv"></div>

and it should work.
 
Maya Li responded:  2012-01-05 14:11
Yes, this works. I must say this is a very strange and unexpected behavior. Thanks for the help.