Solved

stay on top window

Posted on 2000-03-24
6
212 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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-…
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now