?
Solved

stay on top window

Posted on 2000-03-24
6
Medium Priority
?
227 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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
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 200 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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

569 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