Click to See Complete Forum and Search --> : language site problems
seanwriley
10-14-2003, 09:20 AM
i am currently working on a page that as of right now, that pops up a smaller window which has accented letters on it, to be placed in the form fields of the main page. The issue right now is of keeping the popup on top, but also allowing the parent page to be altered although it is not in focus... any suggestions or ideas? i am willing to scrap the popup if other/more efficient and user friendly ideas arise too. thanks in advance
jbergthorson
10-14-2003, 09:38 AM
I know of 2 ways of doing what you want. Neither are the perfect solution for everything, but they may be good enough for you.
use a timer on your popup, that after it loses focus for some period of time, it regains focus.
use a modeless dialog box for your "always on top" box. It has the properties that you are looking for. It is always on top and allows for interaction with any window under it. The only problem is that it is IE only. I have seen someone's site who claims to have made one for NN, but I have never tested it. To open a modeless dialog box you do this:
var myObject = new Object();
myObject.someVarToPass = aVar;
myWindowVar = window.showModelessDialog("myPage.html",myObject, "dialogHeight:250px; dialogWidth:210px; dialogLeft:0px; dialogTop:0px; resizable:yes; help:no; status:no");
Those are not all the parameters in the last set of quotes, but most of them. Here is the complete list:
dialogHeight: sHeight
dialogLeft: sXpos
dialogTop: sYpos
dialogWidth: sWidth
center: ( yes | no | 1 | 0 | on | off )
dialogHide: ( yes | no | 1 | 0 | on | off )
edge: ( sunken | raised )
help: ( yes | no | 1 | 0 | on | off )
resizable: ( yes | no | 1 | 0 | on | off )
scroll: ( yes | no | 1 | 0 | on | off )
status: ( yes | no | 1 | 0 | on | off )
unadorned: ( yes | no | 1 | 0 | on | off )
from www.webreference.com
I don't remember the link to the website with NN enabled modeless dialog boxes, but just do a quick search on google, as that is how i found it before.
So as long as your users are all IE equiped then i would say go with the modeless dialog as it works great(i have used it a number of times).
If you don't know what your visitors are using, you can setup a counter with bravenet or someone who tracks what OS, browser, etc are visiting your site and go by those stats.
Hope that helps,
Jason
seanwriley
10-14-2003, 11:35 AM
thanks jason, a modeless dialog box seems like it will do what I need, no problems so far
sean
seanwriley
10-14-2003, 11:56 AM
as of right now, the html file will not load in the modeless dialog box, it just shows up blank... any suggestions?
sean
jbergthorson
10-14-2003, 12:26 PM
make sure you are using the code format i provided and that the file exists. Also, you do not have to pass it an object if there are no variables you want it to have. If you do pass it an object i forgot to tell you how to access them. You would use:
var myPassedVar=window.dialogArguments.PassedVar;
in the file that is loaded in the dialog box.
Can you post your code for calling the dailog box, so that i can ensure that it is correct, or send me a link to the page you are working on if you have one. (also the code in the modeless dialog html file)
jason
seanwriley
10-16-2003, 09:05 AM
I want to know how to alter the following document so it can pass characters to the parent window: The old solution, which is shown below, will not work with the new modeless setup... Thanks in Advance
Here is a portion of the code,
MODELESS DIALOG BOX:
<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<BODY bgcolor="000000" vlink="yellow" link="yellow" alink="yellow">
<P>
<TABLE BORDER="1">
<TR>
<TD><FONT SIZE=4><a href="javascript:uoid(0)" onClick="window.opener.document.regform.test[(window.opener.currentfield)].value=window.opener.document.regform.test[(window.opener.currentfield)].value+'à';window.opener.document.regform.test[(window.opener.currentfield)].focus()">à</a></FONT></TD>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
<P>
</BODY>
</HTML>
jbergthorson
10-16-2003, 09:23 AM
hey,
to access the parent from the modeless dialog, i always just pass it a pointer to the parent like this:
var myObject = new Object();
myObject.myParent = window;
modelessWindow = window.showModelessDialog("myFile.html",myObject, "dialogHeight:250px; dialogWidth:210px; dialogLeft:0px; dialogTop:0px; resizable:yes; help:no; status:no");
Then in the modeless i do:
var myParent=window.dialogArguments.myParent;
myParent.someVariable = 12;
myParent.someFunction();
etc
There probably is a way to access the opener, but i never bothered to learn it as this is pretty simple and works just fine.
If you just want access to certain variables, you can just pass them in the "myObject".
ie:
myObject.someNewVar1 = myVar1;
myObject.someNewVar2 = myVar2;
myObject.someNewVar3 = myVar3;
modelessWindow = window.showModelessDialog("myFile.html",myObject, "dialogHeight:250px; dialogWidth:210px; dialogLeft:0px; dialogTop:0px; resizable:yes; help:no; status:no");
then access them in the modeless the same as above.
hope that helps
jason