Solved

stay on top window

Posted on 2000-03-24
6
215 Views
Last Modified: 2012-05-04
Ok I am very stuck on this problem.

I have a main page with 2 buttons, pressing a button launches a little popup window
the popup window has content in accordance with the variable passed to it in the url querystring.
1 or 2

The first time I load the main page and click on button1, the Popup window
is created and displays fine.
Then I click on button2 , doing so the Popup window looses focus as the main window
is brought to the front. I alt tab to the Popup window ,and the contents of which
are fine (number 2 content).

The problem is I don't want to have to alt tab to the popup window, is there a way to
make the popup stay on top???

If no one can give me a solution for this then I will delete this question, I have
already spent points searching experts-exchange for an answer, and turned up nothing
of and substance. infact the general concensus is it cannot be done ..

lala lala lala rubbish!

It can be done the question is how?


here is a previous answer that does not work for example:
//   if (document.all) WinHandle = window.showModalDialog("DayView.asp?PersonID="+P+"&TheDate="+D+"&AMPMCode="+C,'arguments','dialogWidth=360,dialogHeight=290')
//   else WinHandle = window.open("DayView.asp?PersonID="+P+"&TheDate="+D+"&AMPMCode="+C,"DetailView",["resizable=0,width=360,height=290,alwaysRaised"]);

and the idea of onbluring setfocusing aslo does not work.


Here is a snippet of my code:



<script Language="JavaScript">

function ShowDetail(num)
{
  var N = num;
  DayWindow = window.open("Popup.asp?num="+N,"DetailView",["resizable=0,width=360,height=290"]);
}

</script>


<input type="button1" value="open win1" onclick="ShowDetail(1)">
<input type="button2" value="open win2" onclick="ShowDetail(2)">


Rob;-)
<no points if you tell me its not possible>
0
Comment
Question by:RBertora
6 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 2653870
how about this:

<input type="button1" value="open win1" onclick="ShowDetail(1); window.setTimeout('window.detailview.focus()',500)">
<input type="button2" value="open win2" onclick="ShowDetail(2); window.setTimeout('window.detailview.focus()',500)">

I'm not sure but it might work!

Max Davidse
0
 
LVL 7

Author Comment

by:RBertora
ID: 2654035
nope:
window.detailview is not an object...
Rob;-)
0
 
LVL 11

Expert Comment

by:kmartin7
ID: 2654949
>and the idea of onbluring setfocusing aslo does not work

Why?  If you use a hidden frameset with a script that sets focus in the hidden part of the frameset, this should cause the window to stay focused.

If you need help implementing, please let me know...

Kurt
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:DreamMaster
ID: 2659698
DUHH!!! That's his question Kurt!
0
 
LVL 7

Author Comment

by:RBertora
ID: 2660033
Hi,
Yes Kurt please post some code & how to implement it.
Rob;-)
0
 

Accepted Solution

by:
loveleen earned 100 total points
ID: 2771871
put
 <body onLoad="if(window.focus) window.focus()">

in the page you load

I had a similar problem using links instead of buttons, Michel helped me with it, it worked for both Netscape and IE. You can have a look at the way it works at:
http://www.auckland.ac.nz/itss/Software/spss_site_license.html

Try the links under Products Available.

Cheers
Loveleen
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now