|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OnDocumentReady with Treeview HTC (in a popup)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 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>
Control of a map where the user can click and drag to select an area...
datagrid update/cancel command not working Architectural design question - please advise Failed validation doesn't stop page from posting back Binding Typed datasets to grid controls in designer Validation Summary Control does not apprear How do I stop this javascript from being emitted? A Repeater Question. Button highlight or enhance when mouse over Validation before or after CreateChildControls |
|||||||||||||||||||||||