This is a migrated thread and some comments may be shown as answers.

radwindow.close() takes focus

1 Answer 97 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bill Ehrreich
Top achievements
Rank 1
Bill Ehrreich asked on 26 Jan 2011, 02:46 PM
I have a main page that contains a radwindow.  From a link in the main page, I use javascript to open the radwindow and set the dialog page inside the radwindow's iframe (setUrl).  The user makes selections in the dialog page then clicks "Go".  I then write javascript to the browser to open a brand new "report" window and give it focus.  Lastly, I write javascript to the browser that calls the close() method for the radwindow in the main page.

In Firefox everything works fine.
In IE7 and IE8, the main page always takes the focus after I close the radwindow.  If I don't close the radwindow or I simply hide it, the report window retains focus as it should.

For the moment, I am instead forcing a postback on the main page.  This closes the dialog but does not steal the focus.  However, this is a poor approach that I do not want to use if I can avoid it.

How do I keep the main page from getting the focus after I close the radwindow?

Thanks,

Bill

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 01 Feb 2011, 10:59 AM
Hello Bill,

If I understand your scenario correctly, the problem comes from the sequence of the events:
  1. focus is on the main page
  2. focus is moved in the content page (displayed in a RadWindow)
  3. focus is moved to the new browser's popup.
  4. focus moves back to the RadWindow, as you execute code in it (GetRadWindow().close())
  5. focus automatically moves to the main page

What I would suggest is to try opening the new browser's popup not from the content page (displayed in the RadWindow) but from the parent one - you could use RadWindow's OnClientClose event to execute the JavaScript on the main page.

I hope this helps.
Kind regards,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Bill Ehrreich
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or