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

[Solved] uncaught exception: The container of an boundary-point of a range is being set to either a node of an invalid type or a node with an ancestor of an invalid type. (NS_ERROR_DOM_RANGE_INVALID_NODE_TYPE_

7 Answers 133 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 30 Jun 2009, 05:22 PM
Hi Rad Team,

we are using a RadComboBox in an RadAjaxPanel and we have some issues in Firefox 3. In IE7 the page works perfectly, but in FF3 after the SelectedItem changed and the ajax call comes back there is problem, the ComboBox freezes and (other possibly RadControls in the same Panel).

Firebug reported me following problem:

uncaught exception: The container of an boundary-point of a range is being set to either a node of an invalid type or a node with an ancestor of an invalid type. (NS_ERROR_DOM_RANGE_INVALID_NODE_TYPE_ERR)

It also states this exception happens in line 8340 of the follwong code:

8216//////////////////////// IE functionality for Mozilla/Netscape ///////////////////////////////
8217 // make Mozilla browsers emulate IE's node/element functionality
8218if (isNav) {
8219 Element.prototype.contains = function(element){
8220 var range=document.createRange();
8221 range.selectNode(this);
8222 return range.compareNode(element)==3;
8223 }
8224
8225 Element.prototype.applyElement = function(element, where){
8226 if(!element.splitText){
8227 element.removeNode();
8228 if(where && where.toLowerCase()=="inside"){
8229 for(var i=0;i<this.childNodes.length;i++){
8230 element.appendChild(this.childNodes[i])
8231 }
8232 this.appendChild(element)
8233 }else{
8234 var parent_Node=this.parentNode;
8235 parent_Node.insertBefore(element,this);
8236 element.appendChild(this);
8237 }
8238 return element;
8239 }
8240 }
8241
8242 Element.prototype.insertAdjacent=function(where, element){
8243 var parent_Node=this.parentNode;
8244 switch(where.toLowerCase()) {
8245 case "beforebegin":
8246 parent_Node.insertBefore(element,this);
8247 break;
8248 case "afterend":
8249 parent_Node.insertBefore(element,this.nextSibling);
8250 break;
8251 case "afterbegin":
8252 this.insertBefore(element,this.childNodes[0]);
8253 break;
8254 case "beforeend":
8255 this.appendChild(element);
8256 break;
8257 }
8258 }
8259
8260 Element.prototype.insertAdjacentText = function(where, text){
8261 var text_Node=document.createTextNode(text||"")
8262 this.insertAdjacent(where, text_Node);
8263 }
8264
8265 Element.prototype.insertAdjacentHTML = function(where, html){
8266 var range=document.createRange();
8267 range.selectNode(this);
8268 var fragment=range.createContextualFragment(html);
8269 this.insertAdjacent(where, fragment);
8270 }
8271
8272 Element.prototype.insertAdjacentElement = function(where,element){
8273 this.insertAdjacent(where,element);
8274 return a2;
8275 }
8276
8277// Node.prototype.removeNode = function (node){
8278// var parent_Node=this.parentNode;
8279// if(parent_Node && !node){
8280// var fragment=document.createDocumentFragment();
8281// for(var i=0;i<this.childNodes.length;i++){
8282// fragment.appendChild(this.childNodes[i])
8283// }
8284// parent_Node.insertBefore(fragment,this)
8285// }
8286// return parent_Node ? parent_Node.removeChild(this):this;
8287// }
8288
8289 Node.prototype.removeNode = function( removeChildren ) {
8290 var self = this;
8291 if ( Boolean( removeChildren ) )
8292 {
8293 return this.parentNode.removeChild( self );
8294 }
8295 else
8296 {
8297 var range = document.createRange();
8298 range.selectNodeContents( self );
8299 return this.parentNode.replaceChild( range.extractContents(), self );
8300 }
8301 }
8302
8303 Node.prototype.replaceNode = function (node){
8304 return this.parentNode.replaceChild(node,this)
8305 }
8306
8307 Node.prototype.swapNode=function(node){
8308 var parent_Node=node.parentNode;
8309 var next_Sibling=node.nextSibling;
8310 this.parentNode.replaceChild(node,this);
8311 parent_Node.insertBefore(this, next_Sibling)
8312 return this;
8313 }
8314
8315 // outerHTML implementation
8316 var _emptyTags = {
8317 "IMG": true,
8318 "BR": true,
8319 "INPUT": true,
8320 "META": true,
8321 "LINK": true,
8322 "PARAM": true,
8323 "HR": true
8324 };
8325
8326 HTMLElement.prototype.__defineGetter__("outerHTML", function () {
8327 var attrs = this.attributes;
8328 var str = "<" + this.tagName;
8329 for (var i = 0; i < attrs.length; i++)
8330 str += " " + attrs[i].name + "=\"" + attrs[i].value + "\"";
8331
8332 if (_emptyTags[this.tagName])
8333 return str + ">";
8334
8335 return str + ">" + this.innerHTML + "</" + this.tagName + ">";
8336 });
8337
8338 HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {
8339 var r = this.ownerDocument.createRange();
8340 r.setStartBefore(this);
8341 var df = r.createContextualFragment(sHTML);
8342 this.parentNode.replaceChild(df, this);
8343 });
8344
8345}

Do you have any idea for fixing this?

Thanks, Stefan



7 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Jul 2009, 08:28 AM
Hello Stefan,

That code is not part of RadControls for ASP.NET Ajax. Are you using any other JavaScript libraries or third party controls?

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stefan
Top achievements
Rank 1
answered on 01 Jul 2009, 09:49 AM
Hi Albert,

indeed we are using a third party control called MapResourceManager, it's a control build by esri a GIS tooling provider. We need that control, as we're building a GIS app.

The problem must be due to some interference between this MapResourceManager, the RadComboBox and FF3 java script engine.

I thought it's your code, because Firebug states that it's coming from:

http://localhost:4871/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.1.311.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ae7ad36d2-e9ec-4737-9fbd-fcc9c464e2bd%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3a1e771326%3aaa288e2d%3bESRI.ArcGIS.ADF.Web.UI.WebControls%2c+Version%3d9.3.1.1850%2c+Culture%3dneutral%2c+PublicKeyToken%3d8fc3cc631e44ad86%3aen-US%3a961bd47f-de26-4f63-8ec9-1b4e5245bfd5%3ac5527224%3aa8a8211a%3a6f849c84

But I didn't actually check all that string, now I just saw, that there's also esri included. But I don't really understand what all that means. Is it because the java script code is somehow merged and in firefox there is some problem about this?
0
Atanas Korchev
Telerik team
answered on 01 Jul 2009, 09:55 AM
Hello Stefan,

We are not familiar with the MapResourceManager control and have not tested it. We are not sure if there is some sort of conflict. I suggest you open a support ticket and attach a running web page which demonstrates the problem you are having. We will check for any conflicts and get back with a solution.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stefan
Top achievements
Rank 1
answered on 01 Jul 2009, 10:36 AM
Hi Albert,

that sounds good, we gonna do that, thanks,

Stefan
0
Wade Koteras
Top achievements
Rank 1
answered on 07 Aug 2009, 02:52 PM
Stefan,

I'm not sure what other problems this may cause, but it got me past the problem that you are experiencing.  I placed the following at the end of the script block in the page containing the ESRI controls and RadComboBox:
if (Sys.Browser.agent == Sys.Browser.Firefox) {  
    HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {  
       if (this.ownerDocument == null || this.parentNode == null) {  
           return false;  
       }  
       var r = this.ownerDocument.createRange();  
       r.setStartBefore(this);  
       var df = r.createContextualFragment(sHTML);  
       this.parentNode.replaceChild(df, this);  
    });  

It seems that the ESRI TOC control is based on another party's control that emits the HTMLElement.prototype.__defineSetter__ when the user agent is Firefox.  Their definition of the setter causes problems with the RadComboBox.  By inserting the above code, you essentially short-circuit the effects of their version of that setter.

Good luck,
Wade
0
Stefan
Top achievements
Rank 1
answered on 02 Sep 2009, 11:55 AM
Hi Wade,

I included your script and reincluded a lot of RadComboBoxes around 2 weeks ago into our project and till right now it seems to work fine without breaking the esri controls. Great job, thanks a lot!!!

Best greetings Stefan
0
Andrea Doberstein
Top achievements
Rank 1
answered on 15 Jan 2010, 01:27 PM
Hy Wade!

I can't believe that I found such a great solution in Telerik forum. I've searched for hours, too. Now I found your post - Thanks a lot!
Andrea

Tags
ComboBox
Asked by
Stefan
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Stefan
Top achievements
Rank 1
Wade Koteras
Top achievements
Rank 1
Andrea Doberstein
Top achievements
Rank 1
Share this question
or