Hello,
We are using 2011 vol1 and the WebDateChooser is throwing this javascript error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; IPH 1.1.21.4019; Zune 4.7) Timestamp: Tue, 4 Dec 2012 15:31:54 UTC
Message: Unable to get value of the property 'style': object is null or undefined Line: 305 Char: 21 Code: 0 URI: https://localhost/CertifyApp/ScriptResource.axd?d=j737ukg33S-LMMN5RsJojVBC2J0IjTLf6Ns3V8dyO3gwm7V2kAERvhC7kgpfFscXaHiPgP2G49G2ro6gRz6Cp2461phVSRB04JaBI0Zx9a_CgCXZwxV1hMunPC9YO4RqdZ63T6W1sl23h-YrtaZOm4_lo3KdGR4z3Jujt82qLYxJ9L4kNtnqhAsnhx76CyLKeYwCImD7AB7DCP20tmapv8_Z3SgelTT8Ot52eNZRNS41&t=d158ead
This is happening in the javascript file that comes from ScriptResource.axd. The top line of the file that is being served to the browser says:
//vs 100510
Here are lines 303 to 313 of that file (which includes line 305 where the exception is taking place):
this.doEvt=function(evt,type,src)
{
if(type=="resize")this.inputBox.style.width="100%";
else if(this.isEnabled()&&this.Loaded&&!this.isReadOnly())switch(type)
case "mousedown":this.doMousedown(evt,src);return;
case "mouseup":case "mouseout":this._state(0);return;
case "mouseover":this._state(1);return;
case "keydown":this.onImgKey(evt);return;
}
Line 305 is the line that is throwing the error and here is that line:
When the error happens, this.inputBox is null. "this" has a value and seems fine, but the inputBox is null.
Any ideas what we should do to resolve this?
Many thanks!
Hello Autharch,
What build version of 2011 Vol 1 are you using? You can find this information in the web.config. This number should look like
11.1.20111.1010. I need last four digits. So that I can test with the version and see if I am able to reproduce the issue.
Please let me know if you have any further questions regarding this matter.
Our build number is 11.1.20111.2238
Thank you!
Oh, a little more information... In order to see this error we have to go into Tools/Advanced in Internet Explorer and uncheck both of the "Disable script debugging" checkboxes, and also check the checkbox labeled "Display a notification about every script error".
I did more research and I found that for some reason updating an UpdatePanel is triggering resize event on the WebDateChooser before the control is properly initialized. Do you have any ideas as to why an UpdatePanel would cause this behavior?
Alternatively, how could I modify the javascript? I could work around this easily by adding one line of code as follows:
this.doEvt=function(evt,type,src) { if(this.inputBox === null) { return; } // This line added by me... if(type=="resize")this.inputBox.style.width="100%"; else if(this.isEnabled()&&this.Loaded&&!this.isReadOnly())switch(type) { case "mousedown":this.doMousedown(evt,src);return; case "mouseup":case "mouseout":this._state(0);return; case "mouseover":this._state(1);return; case "keydown":this.onImgKey(evt);return; } }
But I would need a simple way to modify that javascript file. Is there a simple way?