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

ParentNode is null

3 Answers 104 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Geert
Top achievements
Rank 1
Geert asked on 27 Nov 2008, 05:08 PM
Hello,

I reported an issue some weeks ago on a javascript error that blocks our application.
Now I figured out what the reason is for this error. The solution on the other hand is unknown and may be something tricky. So I hope you can find it out because my projectleader has pulled out all of his hair from frustration. I'm afraid my hair is next as long as the problem continues.

Ok the reason/scenario:

make a sample project with a page that dynamically creates a usercontrol and each time there is a postback (Ajax or not) you'll have to build the usercontrol from zero.
On the usercontrol set a control e.g. radcombobox and fill it up with 250 items (so the server will have something to process).
Create a button beneath it that will trigger a refill of the combobox.
Make a loadingpanel and a radajaxmanager that will update a panel which only contains the dropdown. Make sure the button does not belong in the panel so it is clickable during the loadingscreen.

No click that button as hell, as fast as you can and then the following error will occur in javascript:
_d5.parentNode is null where 5 is a sequence.

I traced it back in the javascript of telerik so this might help in the search:

1810  var _d2=$get(_d1);
1811  var _d3=String.format("{0}_wrapper",_d1);
1812  var _d4=$get(_d3);
1813  if(_d4){
1814  _d2=_d4;
1815  }
1816  if(this.get_element()==null){
1817  return;
1818  }
1819  var _d5=(!this._isSticky)?$get(this.get_element().id+_d1):this.get_element();
1820  var now=new Date();
1821  if(_d5==null){
1822  return;
1823  }
1824  var _d7=now-_d5._startDisplayTime;
1825  var _d8=this._minDisplayTime;
1826  if(this._isSticky){
1827  if(_d8>_d7){
1828  window.setTimeout(function(){
1829  _d5.style.display="none";
1830  },_d8);
1831  }else{
1832  _d5.style.display="none";
1833  }
1834  }else{
1835  if(_d8>_d7){
1836  window.setTimeout(function(){
1837  _d5.parentNode.removeChild(_d5);
1838  if(typeof (_d2)!="undefined"&&(_d2!=null)){
1839  _d2.style.visibility="visible";
1840  }
1841  },_d8);
1842  }else{
1843  _d5.parentNode.removeChild(_d5);
1844  if(typeof (_d2)!="undefined"&&(_d2!=null)){
1845  _d2.style.visibility="visible";
1846  }
1847  }
1848  }
the error occurs on line 1837

Hope this helps because I really love my hair,

Thanks in advance,

the SOFIM-team (Belgium)

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 02 Dec 2008, 11:29 AM
Hi Geert,

Following your instructions I have prepared a small sample website which you can find attached to this message. I could not observe the problem you describe. Take a look at it and see how it behaves on your end and if there are any crucial differences in the logic compared to your problematic project. Let us know how it goes.

Kind regards,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Geert
Top achievements
Rank 1
answered on 02 Dec 2008, 01:00 PM
Hello,

First of all thanks for the response, really appreciate it.
Second, The problem does not appear in your example but I have configured out why:

- the for loop 2500 items instead of 250
- Place the loadingpanel in the default aspx instead of the ascx

- Add the following code to the loadingPanel: MinDisplayTime="500" Transparency="40"
Now play again and click fast on the update button
this is My result (with firebug)

[Exception... "'Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: http://localhost:1459/Ajax/... :: Sys$Net$XMLHttpExecutor$abort :: line 5344" data: no]

è  this._upperAbbrMonths = this...s.dateTimeFormat.AbbreviatedMonthNames);

ScriptRe...002031250 (regel (7069)

 

AND

_d6.parentNode is null

è  _d6.parentNode.removeChild(_d6); 

Thanks in advance

The SOFIM-team (Belgium)

0
Pavel
Telerik team
answered on 03 Dec 2008, 08:52 AM
Hi Geert,

Indeed the problem can be observed when the suggested modifications are made. You can workaround it by setting the RequestQueueSize property for the RadAjaxManager like this:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RequestQueueSize="2"></telerik:RadAjaxManager> 

Alternatively, in order to ensure that the button won't be clicked when the request is executing, you can disable it in the OnRequestStart client side event of the Manager and then OnRequestEnd enable it again.

Give these suggestions a try and let us know if you need additional help.

Greetings,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Geert
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Geert
Top achievements
Rank 1
Share this question
or