OnDocumentReady with Treeview HTC (in a popup)

D

dgl3906464

All,
I've seeing a very odd behavior:
I've got a treeview control (implemented with treeview.htc) that
renders fine.
If I put that treeview on a page, it renders and behaves normally.
If I put that treeview into a popup (created with
window.createPopup()), it renders fine, but the onDocumentReady event
never fires. onContentReady does, but onDocumentReady does not?
What's that leave me? A treeview that renders with no events
attached?

Very very odd.

<HTML><!-- XMLNS:mytree>-->
<head>
<!-- <?IMPORT NAMESPACE="mytree" IMPLEMENTATION="treeview.htc"/> -->
<title>TreeCwbs</title>
<script>
function makePopup(x,y){
var oCWBSPopup
if(!window.oCWBSPopup) {
oCWBSPopup = window.createPopup();
oCWBSPopup.document.body.style.border="2px white window-inset";

// as you can see, we're making a poup with an embedded treeview
// using write, we can set the namespace and perform an import
// directive - remember that these elements are not in the DOM
// and are not scriptable. The tree RENDERS fine, but never
// attaches events, and the onDocumentReady event never fires.

var popupBody[0] = '<HTML XMLNS:mytree><HEAD>';
popupBody[1] = '<?IMPORT NAMESPACE="mytree" ';
popupBody[2] = ' IMPLEMENTATION="treeview.htc"/>';
popupBody[3] = '</HEAD><BODY>';
popupBody[4] = '<mytree:treeview id="tree1" ';
popupBody[5] = ' TreeNodeSrc="template.xml" ';
popupBody[6] = ' TreeNodeXsltSrc="template.xsl" />';
popupBody[7] = '</BODY></HTML>';
oCWBSPopup.document.write(popupBody.join(''));
window.oCWBSPopup = oCWBSPopup;
} else
oCWBSPopup = window.oCWBSPopup;
oCWBSPopup.show(x-5,y-5,500,300,document.body);
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<span onclick="makePopup(event.x,event.y);" >
<img src="images/folder.gif"/>
</span><br/>

<!-- When the HTML comment blocks are
un-commented, the regular treeview below
works fine -->
<!--
<mytree:treeview id="tree1"
TreeNodeSrc="template.xml"
TreeNodeXsltSrc="template.xsl" /> -->
</form>
</body>
</HTML>

Suggestions?

-Daniel
 
D

dgl3906464

All - here's an edited version that should be easier to play with:

<HTML><!-- XMLNS:mytree>-->
<head>
<!-- <?IMPORT NAMESPACE="mytree" IMPLEMENTATION="treeview.htc"/>-->
<title>TreeCwbs</title>
<script>
function makePopup(x,y){
var oCWBSPopup
if(!window.oCWBSPopup) {
oCWBSPopup = window.createPopup();
oCWBSPopup.document.body.style.border="2px white window-inset";

// as you can see, we're making a poup with an embedded treeview
// using write, we can set the namespace and perform an import
// directive - remember that these elements are not in the DOM
// and are not scriptable. The tree RENDERS fine, but never
// attaches events, and the onDocumentReady event never fires.

var popupBody=new Array(10);
popupBody[0] = '<HTML XMLNS:mytree><HEAD>';
popupBody[1] = '<?IMPORT NAMESPACE="mytree" ';
popupBody[2] = ' IMPLEMENTATION="treeview.htc"/>';
popupBody[3] = '</HEAD><BODY>';
popupBody[4] = '<mytree:treeview id="tree1" >';
popupBody[5] = ' <mytree:treenode text="a">';
popupBody[6] = ' <mytree:treenode text="b"/>';
popupBody[7] = ' </mytree:treenode>';
popupBody[8] = '</mytree:treeview>';
popupBody[9] = '</BODY></HTML>';
oCWBSPopup.document.write(popupBody.join(''));
window.oCWBSPopup = oCWBSPopup;
} else
oCWBSPopup = window.oCWBSPopup;
oCWBSPopup.show(x-5,y-5,500,300,document.body);
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<span onclick="makePopup(event.x,event.y);" >
<img src="images/folder.gif"/>
</span><br/>

<!-- When the HTML comment blocks are
un-commented, the regular treeview below
works fine -->
<!--
<mytree:treeview id="tree1" >';
<mytree:treenode text="a">';
<mytree:treenode text="b"/>';
</mytree:treenode>';
</mytree:treeview>-->
</form>
</body>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top