Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2008, 10:30 AM
Authorized User
 
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default force popup window focus

Hi,

I have a form within a web application that allows users to delete records from a select list control. When the user clicks the delete button in the form, the application displays a jsp popup window. I have done everything i can think to do to lock the application down so that the user has to address the popup dialog before they can take any other action in the application.

On clicking the delete button in the main window's form, the select list control is disabled. The jsp popup window declares an event in its body tag:

onblur="self.focus()"

Doing these two things has assured that, so long as the user doesn't navigate away from the browser, they will have to address the popup
dialog by clicking a 'yes' or 'no' button, or they will have to dismiss it by clicking the 'X' close button at the upper right hand corner of the popup window.

The problem is, when the user leaves the browser by selecting any other application, and then returns to the main window they are able to click on elements on the page at that point - doing so generates servlet errors in the application.

I would like to either force the popup window to the foreground when the user returns to the web application. I want to avoid using
javascript confirm() dialogs, as the application standard for this webapp is to use jsp popups.

I have looked through a bunch of documentation on javascript events and DOM objects, and i cannot see a way i can do that.

Does anyone have any ideas?

Any help is greatly appreciated.

Thanks,
Jake

 
Old May 22nd, 2008, 10:41 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In IE you can use showModalDialog. Alternatively you can use the technique used by the Ajax Control Toolkit Modal Popup: http://www.asp.net/AJAX/AjaxControlT...odalPopup.aspx. This basically puts a div across the page and catches all mouse clicks. The JavaScript is available from that link.

--

Joe (Microsoft MVP - XML)
 
Old May 22nd, 2008, 11:33 AM
Authorized User
 
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestions. I'll play around with it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Window.Focus() rahimzai Javascript 3 December 20th, 2006 09:12 AM
Can I force a browser's window size chrscote Javascript How-To 2 May 27th, 2005 03:13 PM
Ultimate Window Focus fs22 Javascript 1 April 16th, 2005 06:56 AM
popup window sankar Pro VB 6 0 July 29th, 2003 01:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.