'undefined' is null or not an object


I got this error when testing the OpenDialogButton in IE7 when I try to close the dialog using the IE7 tab close button.
The sample in http://www.metabuilders.com/Tools/DialogWindow.aspx also produces the same error in IE7, open a "poorly" designed dialog box, then close the tab/window via its close button.

file attachments


ewsachse wrote May 28, 2008 at 2:29 PM

I found the source of the error in the MetaBuilders_DialogWindow_DoDialogPostBack function in the DialogWindowBaseScript.js file. It was not checking if the result was undefined. See below.

broken code:
if ( result == null) {
result = info.DefaultValue;

fixed code:
if ( result == null || result == undefined) {
result = info.DefaultValue;

I also attached an updated DialogWindowBaseScript.js if you want to get the source and rebuild the project with this change.

wrote May 28, 2008 at 2:29 PM

litasst wrote Nov 2, 2010 at 3:24 PM

Thanks ewsachse! That fixed the DialogWindow and DialogInputBox in one fell swoop!

wrote Feb 14, 2013 at 2:25 AM