• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Bringing popup window to foreground

 
Ranch Hand
Posts: 59
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i had written a javascript code in my application , if the user is idle for 5 mintues then it opens a warning window where the user will be informed that session will be expired in another 4 mintues. The issue is as follows

1. The user opens the my web application in the browser.
2. minimizes the browser and works on excel or notepad or any other application.
3. As the user is not operating on my web application, after 5 idle mintues a popup will be opened with session warning message.
4. Here as the focus is on another application other than browser the popup is not coming to foreground, it just getting blinked in the taskbar.

So i need to bring the popup window to foreground , so that user will get noticed and saves his work in my application.

I tried using the focus method on popup window ,but still facing the same issue....


Please suggest me the best approach way. .....
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. If the browser doesn't have focus, you can't bring it to the front. That is for the user's protection. If I went to a webpage that could constantly interrupt other apps, that would be bad.

What you can do it popup and alert. In some browsers/operating systems, this will cause the window to blink or get the user's attention. It will not bring your peop up to the front either though.

Also, 5 minutes seems like a very short timeout.
 
Ravi Majety
Ranch Hand
Posts: 59
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne

Jeanne Boyarsky wrote:Also, 5 minutes seems like a very short timeout.



I had given 5 mintues as an example. Here we are configuring session Timeout as 60 mins. So Warning window would display after 55 idle minutes.

Jeanne Boyarsky wrote:
You can't. If the browser doesn't have focus, you can't bring it to the front. That is for the user's protection. If I went to a webpage that could constantly interrupt other apps, that would be bad.



What you mentioned is absolutely right. It looks good for some public websites,but here the user is expecting the immediate attention .

In C# i had come across a function SetForegroundWindow which forces the window to move to foreground. Are we not having similar functions in javscript?


 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does not matter if it is internal, you can not make a browser act like a client app.

Eric
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And thank goodness. Can you imagine the nightmare of windows popping themselves to the front constantly?
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic