Solved

stay on top window

Posted on 2000-03-24
6
218 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

840 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