function returnToParent() |
{ |
window.open(report + paras, "", "height=740,scrollbars=yes,width=1000,status=yes,toolbar=yes,menubar=yes,resizable=yes"); |
self.close(); |
} |
I think what's happening is the RadWindow opens the new browser window then closes and the focus reverts back to the parent window. End result is the new browser window opened for the report is behind my report selection window. I'd live to have the new window appear on top as the active window. Any ideas?
5 Answers, 1 is accepted
I am not quite sure that I understood your scenario. Could you please rework my test project (I have used RadWindow's close method instead of the self.close()) in order to replicate the behavior that you experience, open a new support ticket and send it back? I will check it and do my best to provide a solution as soon as possible.
All the best,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
However, when the RadWindow closes, the newly opened browser window gets pushed to the background. I'd like it to remain in front.
Is there a way to close the RadWindow that doesn't cause the newly opened window to lose focus?
This is the JavaScript I'm using in the page displayed inside the RadWindow to open the new window and close the RadWindow.
formWindow = window.open(URL,
"_blank"
,
"directories=0,location=0,menubar=0,status=0,toolbar=0,resizable=1,scrollbars=1"
);
var
oWindow =
null
;
if
(window.radWindow)
oWindow = window.radWindow;
else
if
(window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
oWindow.close();
Thank you,
Bryan
When I originally looked at the sample project, I just compared the JavaScript with my own project and didn't see any marked differences. I finally played with it a bit this morning and found that the sample project behaved properly, so I took a closer look. It turns out I'm having focus issues because I'm declaring and using a RadWindow, while the example doesn't. If I take out my RadWindow references from my radOpen call, I don't have issues with the new window appearing in the background. I modified the sample project and it started behaving the same way my current project does.
I changed the sample code from:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
to this:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" Width="650" Height="480" Modal="true" VisibleStatusbar="false" VisibleTitlebar = "true" Behaviors="Close, Move"> </telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
I changed the JavaScript from this:
function openRadWindow() { radopen("Popup.aspx", null).moveTo(0, 0); }
To this:
function openRadWindow() { radopen("Popup.aspx", "RadWindow1").moveTo(0, 0); }
And now it behaves the same way my page does. Any ideas on how to fix this?
I've found that setting Modal = "false" results in the new window opening in the foreground. I'd prefer not to do this, but if this is the only solution, I can live with that.
Thanks,
Bryan
I suggest to try the following:
1) Close the RadWindow first
2) Open the new window with timeout of 0
Both the activities above should not give a visual difference but should change the focus. You should modify your code in manner similar to:
var
oWindow =
null
;
if
(window.radWindow)
oWindow = window.radWindow;
else
if
(window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
oWindow.close();
setTimeout(
function
(){
formWindow = window.open(URL,
"_blank"
,
"directories=0,location=0,menubar=0,status=0,toolbar=0,resizable=1,scrollbars=1"
);
}, 0);
Please, test my suggestion and let me know how it goes.
Kind regards,
Svetlina Anati
the Telerik team
Ah, excellent! Yes, that works. However, I changed the timeout from 0 to 10 because the new window opened behind the parent window intermittently with a timeout of 0. It works everytime with a timeout of 10, though.
Thank you very much for your help!
Bryan