Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default How do you keep multiple popups visible?

    I have an application in which I have small charts in the form of Java popups. I have created these using the Java window.open. There are a couple dozen of these and users can select two or three they would like to look at. I would like them to see all three as they click on the links and be able to stack them.

    Unfortunately, the way window.open works, as they click the second, the first disappears behind the calling window and they can see it only as a minimization tab in the taskbar. I would like them all to stay visible, so they know they are there and can stack them one on top of the other.

    If I knew which ones they were going to select, I could call {newwindow.focus()} {newwindow2.focus()} etc., and bring them all in front of the calling page. I've tried this, and it actually works. However, if one of the "newwindowx" is a window "x" that they have not actually chosen yet, a nasty error message appears.

    Does anyone know how to do this?

    (I would have thought people would want to do this all the time, and I am surprised there is not just an argument in the window.open saying, "Do not do anything to the last popup.")

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,454
    Rep Power
    25

    Default

    Do you have a small program that demonstrates the problem that you could post for all to see?

  3. #3
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default A simple example of Java hiding all but the last popup

    Here is a simple example:


    <! The following is popupmultiple.htm:>
    <html>
    <head>
    <script language="javascript" type="text/javascript">
    <!--
    function popitup1(url) {
    newwindow1=window.open(url,'name1','top=100,left=1 00,height=200,width=150');
    }
    function popitup2(url) {
    newwindow2=window.open(url,'name2','top=150,left=1 50,height=200,width=150');
    }
    function popitup3(url) {
    newwindow3=window.open(url,'name3','top=200,left=2 00,height=200,width=150');
    }
    // -->
    </script>
    </head>
    <body>
    <a href="javascript:popitup1('popup1.htm')"
    >Link to popup1</a><br />
    <a href="javascript:popitup2('popup2.htm')"
    >Link to popup2</a><br />
    <a href="javascript:popitup3('popup3.htm')"
    >Link to popup3</a><br />
    </body>
    </html>



    <! The following is popup1.htm:>
    <html>
    <body>
    <p>This is popup1.</p>
    </body>
    </html>



    <! The following is popup2.htm>
    <html>
    <body>
    <p>This is popup2.</p>
    </body>
    </html>



    <! The following is popup3.htm>
    <html>
    <body>
    <p>This is popup3.</p>
    </body>
    </html>


    No matter what sequence you click the links, only the last one shows above the calling program 'popupmultiple.htm'. Java places the other two underneath this program, as you can see by minimizing it.

    Question: How do you make them all stay on top of the calling program?

    As far as I can tell, the same property applies to any page with popup links. If you click one, the last one disappears. Why does Java insist on hiding the last popup, when you aren't asking it to do so -- and is there any way to tell it, "Don't do that?"

  4. #4
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default The stick-out-your-tongue face covers "colon-p"

    I just noticed the stick-out-your-tongue face icon covering what is supposed to be "colon-p" back-to-back in three places in the above.

  5. #5
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default Clarification of last message

    Just in case somebody might get the wrong idea, there is no "hypen" -- it is just colon then the letter "p" back-to-back.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You know of course that your question has absolutely nothing to do whatsoever with the Java programming language, right? That Java and JavaScript are two completely different animals, and that asking for advice on this here is like asking your barber if you should have a colonoscopy (my answer is yes, if you are over 50, have unexplained bleeding, or a significant family history). I recommend that you find a JavaScript forum for these questions. Much luck.

  7. #7
    Join Date
    Sep 2008
    Posts
    5
    Rep Power
    0

    Default Thanks

    Hi Fubarable,

    Thanks much for the clarification. No, I didn't know that. I guess it shows how much I know -- or more appropriately don't know -- about either! I appreciate your help. I will try to find a JavaScript forum and post the question there.

Similar Threads

  1. Use multiple forms
    By coco in forum Java Applets
    Replies: 2
    Last Post: 06-14-2010, 05:14 AM
  2. Replies: 2
    Last Post: 04-14-2009, 10:01 PM
  3. Replies: 0
    Last Post: 08-04-2008, 12:17 PM
  4. Multiple applets
    By themburu in forum Java Applets
    Replies: 1
    Last Post: 06-20-2008, 01:41 PM
  5. How to make popups like in eclipse
    By ekadosh in forum SWT / JFace
    Replies: 0
    Last Post: 02-04-2008, 07:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •