rendering a QWP Ben Bimber  2010-12-15 08:44
Status: Closed
 
I have the following code on an HTML page. When the QWP renders, instead of just rendering to the DIV, it destroys the rest of the body. Code below:


<html>
<script type="text/javascript">

Ext.onReady(function(){
    new LABKEY.QueryWebPart({
        title: 'Active Forms:',
        schemaName: 'study',
        queryName: 'Clinical Encounters',
        scope: this,
        errorCallback: EHR.UTILITIES.onError
     }).render('ehrDataEntry');
});

</script>
<body>

<div id="ehrDataEntry" />

<p/>

<div>I will get destroyed when the QWP renders</div>

</body>
</html>



However, if I change the div to this:

<div id="ehrDataEntry"></div>

It no longer happens. Is that the expected behavior from an empty tag? Is this more browser behavior than labkey behavior? thanks for the help.
 
 
kevink responded:  2010-12-21 10:03
This is just an html thing. Self-closing <div/> elements are not allowed in html. You'll need to explicitly add the closing </div> tag.
 
Ben Bimber responded:  2010-12-21 10:04
got it. thanks for the reply.