This is a migrated thread and some comments may be shown as answers.

Compatability with other Script-based controls

1 Answer 183 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
fglrxandyou
Top achievements
Rank 1
fglrxandyou asked on 13 Jul 2007, 10:37 PM
I realize Telerik doesn't have any real obligation to support integration of Prometheus with other controls... Nevertheless, I hope that the people here could, at the very least, point me in the right direction.

When placing an Obout SlideMenu inside of a Prometheus splitter, the following error is received
"Sys.InvalidOperationException: Component 'ctl00_pageContentPlaceHolder_testSlidingZone' was not found."

The bottom of the page Source can be seen here, important line in bold.
<script type="text/javascript"
<!-- 
Sys.Application.initialize(); 
// --> 
</script> 
<script type="text/javascript" src="/WebResource.axd?d=Rwcj_e_oC51iOBYh5MayVggtEnmeLfDRSNuJo6MdksaVrQcOvlTrHPUesRdJLOMXq_vmG2D71BdnK7UY7N_ma5uRITJLgmLNvwzBUET2eQk1&t=633171735402723143"></script><script type="text/javascript">try {var oboutSMbreakMenu = new SlideMenu("breakMenu", null, 10, false, "SMParent", "SMParentOver", "SMParentSelected", "SMChild", "SMChildOver", "SMChildSelected", "SMMenu", "SMChildrenBox", null, null, null, null, null, null, "SMImageParent", "SMImageChild", 100, 0, null, false);} catch(e) {}function f_breakMenu() {var i, j, o, oc, ob;o = document.getElementById("breakMenu");for(i = 0; i < o.childNodes.length; i++) {ooc = o.childNodes[i];if(oc.id.substring(0, 2) != "__") {oc.onmouseover = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 1, true);};oc.onmouseout = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 0, true);};if(oc.onclick) {oboutSMbreakMenu.addFunction(oc.onclick, oc.id);oc.onclick = function() {oboutSMbreakMenu.parentClick(this.id); oboutSMbreakMenu.getFunction(this.id)();};oc.firstChild.onclick = function() {oboutSMbreakMenu.parentClick(this.parentElement.id); oboutSMbreakMenu.getFunction(this.parentElement.id)();};}else {oc.onclick = function() {oboutSMbreakMenu.parentClick(this.id);};oc.firstChild.onclick = function() {oboutSMbreakMenu.parentClick(this.parentElement.id);};}} else for(j = 0; j < oc.childNodes.length; j++) {ob = oc.childNodes[j];ob.onmouseover = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 4, true);};ob.onmouseout = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 3, true);};if(ob.onclick) {oboutSMbreakMenu.addFunction(ob.onclick, ob.id);ob.onclick = function() {oboutSMbreakMenu.saveHidden(this.id); oboutSMbreakMenu.getFunction(this.id)();};}else ob.onclick = function() {oboutSMbreakMenu.saveHidden(this.id);};}}oboutSMbreakMenu.buildMenu();}f_breakMenu();</script> 
<script type="text/javascript"
<!-- 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSlidingPane, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSlidingPane_ClientState","Title":"sliding pane","_index":0}, null, {"parent":"ctl00_pageContentPlaceHolder_testSlidingZone","parentPane":"ctl00_pageContentPlaceHolder_testPane","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testSlidingPane")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSlidingZone, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSlidingZone_ClientState","_height":"100%","_width":"22px"}, null, {"parent":"ctl00_pageContentPlaceHolder_testPane","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testSlidingZone")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadPane, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testPane_ClientState","Scrolling":4,"_collapsedDirection":1,"_expandedSize":0,"_height":"400px","_index":0,"_indexInPanes":0,"_originalHeight":400,"_originalWidth":0,"_scrollLeft":0,"_scrollTop":0,"_width":""}, null, {"parent":"ctl00_pageContentPlaceHolder_testSplitter","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testPane")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSplitter, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSplitter_ClientState","_borderSize":1,"_panesBorderSize":1}, null, null, $get("ctl00_pageContentPlaceHolder_testSplitter")); 
}); 
// --> 
 
</script> 

 


When placed outside the control, it renders as follows

<script type="text/javascript"
<!-- 
Sys.Application.initialize(); 
// --> 
</script> 
<script type="text/javascript"
<!-- 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSlidingPane, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSlidingPane_ClientState","Title":"sliding pane","_index":0}, null, {"parent":"ctl00_pageContentPlaceHolder_testSlidingZone","parentPane":"ctl00_pageContentPlaceHolder_testPane","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testSlidingPane")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSlidingZone, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSlidingZone_ClientState","_height":"100%","_width":"22px"}, null, {"parent":"ctl00_pageContentPlaceHolder_testPane","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testSlidingZone")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadPane, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testPane_ClientState","Scrolling":4,"_collapsedDirection":1,"_expandedSize":0,"_height":"400px","_index":0,"_indexInPanes":0,"_originalHeight":400,"_originalWidth":0,"_scrollLeft":0,"_scrollTop":0,"_width":""}, null, {"parent":"ctl00_pageContentPlaceHolder_testSplitter","splitter":"ctl00_pageContentPlaceHolder_testSplitter"}, $get("ctl00_pageContentPlaceHolder_testPane")); 
}); 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadSplitter, {"ClientStateFieldID":"ctl00_pageContentPlaceHolder_testSplitter_ClientState","_borderSize":1,"_panesBorderSize":1}, null, null, $get("ctl00_pageContentPlaceHolder_testSplitter")); 
}); 
// --> 
 
</script> 
<script type="text/javascript" src="/WebResource.axd?d=Rwcj_e_oC51iOBYh5MayVggtEnmeLfDRSNuJo6MdksaVrQcOvlTrHPUesRdJLOMXq_vmG2D71BdnK7UY7N_ma5uRITJLgmLNvwzBUET2eQk1&t=633171735402723143"></script><script type="text/javascript">try {var oboutSMbreakMenu = new SlideMenu("breakMenu", null, 10, false, "SMParent", "SMParentOver", "SMParentSelected", "SMChild", "SMChildOver", "SMChildSelected", "SMMenu", "SMChildrenBox", null, null, null, null, null, null, "SMImageParent", "SMImageChild", 100, 0, null, false);} catch(e) {}function f_breakMenu() {var i, j, o, oc, ob;o = document.getElementById("breakMenu");for(i = 0; i < o.childNodes.length; i++) {ooc = o.childNodes[i];if(oc.id.substring(0, 2) != "__") {oc.onmouseover = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 1, true);};oc.onmouseout = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 0, true);};if(oc.onclick) {oboutSMbreakMenu.addFunction(oc.onclick, oc.id);oc.onclick = function() {oboutSMbreakMenu.parentClick(this.id); oboutSMbreakMenu.getFunction(this.id)();};oc.firstChild.onclick = function() {oboutSMbreakMenu.parentClick(this.parentElement.id); oboutSMbreakMenu.getFunction(this.parentElement.id)();};}else {oc.onclick = function() {oboutSMbreakMenu.parentClick(this.id);};oc.firstChild.onclick = function() {oboutSMbreakMenu.parentClick(this.parentElement.id);};}} else for(j = 0; j < oc.childNodes.length; j++) {ob = oc.childNodes[j];ob.onmouseover = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 4, true);};ob.onmouseout = function() {oboutSMbreakMenu.mouseOverOutSelected(this.id, 3, true);};if(ob.onclick) {oboutSMbreakMenu.addFunction(ob.onclick, ob.id);ob.onclick = function() {oboutSMbreakMenu.saveHidden(this.id); oboutSMbreakMenu.getFunction(this.id)();};}else ob.onclick = function() {oboutSMbreakMenu.saveHidden(this.id);};}}oboutSMbreakMenu.buildMenu();}f_breakMenu();</script> 
 


In that case, there is no error.

Is there some way I can fix this?  I believe it has something to do with script manager... I believe perhaps the obout control is attempting to add that script as an end/onload script, but the telerik one sort of.. prevents it from actually running at the page's end, and puts it beforehand, inbetween the Sys call and the telerik calls?

Thoughts?


1 Answer, 1 is accepted

Sort by
0
fglrxandyou
Top achievements
Rank 1
answered on 14 Jul 2007, 03:58 AM
Okay.

I can tell what's causing it.  No idea how to fix this, or prevent other controls doing the same thing from breaking Telerik controls. 

The Obout control is calling the following in the code Behind:

  this.myScriptManager.RegisterStartupScript(this, webResourceUrl, text, false); 
 
 
... 
 
  text26 = text; 
        text = text26 + "oboutSM" + text3 + ".SafeAddOnload(f_" + text3 + ", oboutSM" + text3 + ");"
        if (height <= 0) 
        { 
            text26 = text; 
            text = text26 + "oboutSM" + text3 + ".SafeAddOnload(function() {oboutSM" + text3 + ".collapseAll()}, oboutSM" + text3 + ");"
        } 
 
... 
 
 this.myScriptManager.RegisterStartupScript(thisthis.ClientID, text, false); 
 
 


Okay, so, to clarify what's going on... It's writing those two lines. the script resource call and the function call... using the RegisterStartupScript method..

The SafeAddOnload is a js which in turn calls a window.onload that I won't reproduce here.



Thus, a Telerik splitter can currently be broken if one of the controls within it uses RegisterStartupScript method, or possibly the window.onload...


I will submit a ticket as well.  I hope this issue can be resolved, so I can move forward with my development.
Tags
Splitter
Asked by
fglrxandyou
Top achievements
Rank 1
Answers by
fglrxandyou
Top achievements
Rank 1
Share this question
or