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!
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?
Hello Autharch,
Please let me know if you have any further questions regarding this matter.
I followed the steps you suggested and was unable to reproduce the behavior you're describing. I am able to see the webdataechooser without any javascript errors.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
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".
Our build number is 11.1.20111.2238
Thank you!