/    Sign up×
Community /Pin to ProfileBookmark

get modeless dialog properties

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

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@DimitriOct 09.2003 — If I may, maybe it would be better if you gave us all the code, instead of just a snippet.

D
Copy linkTweet thisAlerts:
@jbergthorsonauthorOct 10.2003 — 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
×

Success!

Help @jbergthorson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...