hi ;
i am trying to set the size, position, and contentURL of a webmodaldialog from the client-side and i have successful set them. however, when i have the WebModalDialog set to Modal i get an error the first time i display the WebModalDialog. when the WebModalDialog is not set to modal, i do not get the error.
the error occurs in
switch(Sys.Browser.agent) { case Sys.Browser.InternetExplorer: Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { /// <param name="element" domElement="true"></param> /// <returns type="Sys.UI.Point"></returns> var e = Function._validateParams(arguments, [ {name: "element", domElement: true} ]); if (e) throw e; if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0); var clientRects = element.getClientRects(); if (!clientRects || !clientRects.length) { return new Sys.UI.Point(0,0); } var w = element.ownerDocument.parentWindow; var offsetL = w.screenLeft - top.screenLeft - top.document.documentElement.scrollLeft + 2; var offsetT = w.screenTop - top.screenTop - top.document.documentElement.scrollTop + 2; var f = w.frameElement || null; if (f) { var fstyle = f.currentStyle; offsetL += (f.frameBorder || 1) * 2 + (parseInt(fstyle.paddingLeft) || 0) + (parseInt(fstyle.borderLeftWidth) || 0) - element.ownerDocument.documentElement.scrollLeft; offsetT += (f.frameBorder || 1) * 2 + (parseInt(fstyle.paddingTop) || 0) + (parseInt(fstyle.borderTopWidth) || 0) - element.ownerDocument.documentElement.scrollTop; }
the element.ownerDocument.documentElement is null.
i only get this on the first time i display the WebModalDialog and it only happens with IE. i have IE 6.0.
here is the client-side code.
objHelp.setSize( strWidth, strHeight ) ; var resultVar = objHelp.set_moveable( true ); objHelp.set_initialLocation( true ) ; objHelp.set_windowState($IG.DialogWindowState.Normal); objHelp.get_contentPane().set_contentUrl("xxx.aspx?HelpCode=1");
any ideas about the error and also am i able to set the Modal vs NonModal property from the client-side..
i would like to be able to use the same WebDialogWindow for both.
thanks
Hi Bill,
If I understood correctly you have problem only when you use custom code on client. I guess codes in your post show point where exception is raised. It looks like a bug in function getLocation. WebDialogWindow does not use that, but it uses $util.getPosition(elem). If problem in that function, then I suggest you to find out where that call comes from (debug stack or whatever). If it is part of your logic, then you may try to modify it: maybe add validation for document.readyState=='complete', or replace it with getPosition, etc.
hi Viktor;
the only code i am using on the client-side is CSOM to display the WebDialogWIndow. i created a sample web application to send you. how can i get it to you.
Bill Cottrell
When you write a post, there is "File attachment" in Options tab.
it works very well, thank you viktors
Hi Robert,
Changes to modal functionality is supported on server. Changes to that feature on client is not supported because in some cases it may trigger side effects which WebDialogWindow will not be able to overcome.
Application may experiment with that feature on its own. Anybody can look at implementation of igDialogWindow.js (or its embedded codes within debugger) and find out implementation of Modal property. Particularly it has
_get_modal:
function() { return this._get_value($IG.DialogWindowProps.Modal); },
So, oDialog._set_value($IG.DialogWindowProps.Modal, false/true); will change that property. Maybe if it is done while dialog is closed and there are no other dialogs on page, then it may work.Note: using private objects may break application and there is no support in case of misbehavior.
I need to change the ownership "Modal" in my "WebDialogWindow" with java script can someone help me please
I debugged that application. I found that Sys$UI$DomElement$getLocation is used by AJAX framework while raising Sys$UI$DomEvent mousemove events, which is used by WebDialogWindow.
Line where exception is raised seems quite innocent.
offsetL += (f.frameBorder || 1) * 2 + (parseInt(fstyle.paddingLeft) || 0) + (parseInt(fstyle.borderLeftWidth) || 0) -element.ownerDocument.documentElement.scrollLeft;
I checked values of variables and all of them were defined. I tried to calculate that expression in "watch" of debugger and that did not give error, result was Number 0. If debugger points to a correct statement of exception, then the only guess I can have,- that javascript in IE6 fails to perform math with "f.frameBorder" which is String. Maybe parseInt(f.frameBorder) would fix that.
In any case that exception is purely AXAJ problem and unfortunately WebDialogWindow can not remove mousemove handler, because that will disable move features.
hi Viktor.
here is the first zip file. i had to break it into 2 zip files because of the ig_res directory. i am sending the zip of the /ig_res next. do you want me to send the /ig_res directory or do you just want to add it yourself. ?
when you create a web application. the start page is mainpage.aspx.
mainpage.aspx is a page that contains an iframe. in the iframe is a page with a question mark. click on the question mark to display the hidden dialog box.
in ie6, if the webdialogwindow is MODAL=true, i receive an error in ScriptResource.axd. when MODAL=false, i do not receive the error.
i do not receive the error in IE7 nor Firefox.