Click to See Complete Forum and Search --> : get modeless dialog properties


jbergthorson
10-09-2003, 04:04 PM
I create a modeless dialog window and at first set a default dialogWidth, height, top, left.
I want the user to be able to close that window and reopen it. Upon a reopen i want it to *remember* its properties.
I set up an object in my main window that will hold these properties, but I cannot seem to be able to access an open modeless dialog window's properties.

here is my code:
*******************
var fenceWindow = "null";
var fenceWindowObj = new Object();
fenceWindowObj.Height = 300;
fenceWindowObj.Width = 375;
fenceWindowObj.Left = 0;
fenceWindowObj.Top = 0;


function openFenceWindow(){
var myObject = new Object();
myObject.IMSViewer = IMSViewer;

if (fenceWindow != "null"){
if(!fenceWindow.closed){
fenceWindowObj.Height = fenceWindow.dialogHeight;
fenceWindowObj.Width = fenceWindow.dialogWidth;
fenceWindowObj.Left = fenceWindow.dialogLeft;
fenceWindowObj.Top = fenceWindow.dialogTop;
fenceWindow.close();
}
}
fenceWindow = window.showModelessDialog("fences.html",myObject, "dialogHeight:"+fenceWindowObj.Height+"px; dialogWidth:"+fenceWindowObj.Width+"px; dialogLeft:"+fenceWindowObj.Left+"px; dialogTop:"+fenceWindowObj.Top+"px; resizable:yes; help:no; status:no");
}
}
*********************
fenceWindow.dialogHeight, Width, etc are null. I also tried just .Width, .innerWidth, .outerWidth, etc, .pageXOffset, and a bunch of other atttributes i thought would work.

Is it possible to access a modeless dialog window's attributes? Any ideas?

Thanks
jason

Dimitri
10-09-2003, 06:37 PM
If I may, maybe it would be better if you gave us all the code, instead of just a snippet.

D

jbergthorson
10-10-2003, 09:12 AM
That is all the code pretty much. I have an applet that calls that function( openFenceWindow(); ). If the fence modeless dialog window is already open, it *tries* to store the width, height, top and left of the window, closes it and then reopens it in the new location. This is how in effect i do a refresh on the modeless dialog box, or reopen it in the last known spot if the user has already closed it. The only problem I am having is:

fenceWindowObj.Height = fenceWindow.dialogHeight;
fenceWindowObj.Width = fenceWindow.dialogWidth;
fenceWindowObj.Left = fenceWindow.dialogLeft;
fenceWindowObj.Top = fenceWindow.dialogTop;

does not actually get those attributes from fenceWindow. They just return null.
(fenceWindow is the pointer to the modeless dialog box., fenceWindowObj is used to store the fenceWindow's attributes for later use.)

I repoen the window by using this line of code:
fenceWindow = window.showModelessDialog("fences.html",myObject, "dialogHeight:"+fenceWindowObj.Height+"px; dialogWidth:"+fenceWindowObj.Width+"px; dialogLeft:"+fenceWindowObj.Left+"px; dialogTop:"+fenceWindowObj.Top+"px; resizable:yes; help:no; status:no");

And that works just fine. the only problem is I cannot seem to access the width, height, and location of the modeless dialog window.

I don't think i can clarify it anymore than that, but if you have any other questions feel free, as I am not that great at explanations!

Thanks again,

jason