I am opening a RadWindow from within RadWindow as per the examle.
The second radWindow opens up fine, but it opens in the background of the first window. I have to click on the second window then it comes up on the top.
I tried using setActive, setVisible, show - but none of them make the second window on top of first.
Any idea?
-Piyush
19 Answers, 1 is accepted
Can you please provide more details about your exact setup? How exactly you open these windows?
Sincerely yours,
Georgi Tunev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I use these functions to open the Rad window. Strangely, at some places RadWindow within RadWindow opens up fine. But only for the following openReferral() method its not opening up correctly and opening behind another RadWindow.
//used from ApptEdit.aspx for [Attach] button
function openReferral(patId, apptId)
{
var url = 'AddEditReferral.aspx?PatientId=' + patId + '&AppointmentId=' + apptId;
var owindow = OpenRadWindow(url, null, 650, 550);
owindow.center();
owindow.set_Title("Patient Referrals");
owindow.setActive();
owindow.set_Modal(true);
return false;
}
//This code is used to provide a reference to the radwindow "wrapper"
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement && window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)
return oWindow;
}
function OpenRadWindow(url, windowid, width, height)
{
var owindow = GetRadWindow();
var rwindow = null;
if (owindow == null)
{
rwindow = radopen(url, windowid);
}
else
{
rwindow = owindow.BrowserWindow.radopen(url, windowid);
}
if (rwindow != null)
{
rwindow.setSize(width, height);
}
return rwindow;
}//OpenRadWindow
Unfortunately I am still unable to reproduce the problem locally. Please open a support ticket and send me a small sample project where this behavior can be observed - I will check it right away and get back to you with solution.
Greetings,
Georgi Tunev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Parent Page (works perfectly):
var oWnd = window.radopen(null, "ReplaceWindow");
//Create a new Object to be used as an argument to the radWindow
var arg = new Object();
arg.TargetElementID = targetElement.id;
arg.BaseFileName = targetElement.attributes("FileName").value;
arg.CustomerID = targetElement.attributes("CustomerID").value;
//Set the argument object to the radWindow
oWnd.Argument = arg;
oWnd.setUrl(oWnd.get_NavigateUrl());
Replace Window (first window) (this opens the second window but in the background and the first window is not "locked" as it is in the sample online):
var currentWindow = GetRadWindow();
var parentPage = currentWindow.BrowserWindow;
var parentRadWindowManager = parentPage.GetRadWindowManager();
var generateWindow = parentRadWindowManager.open("Window_GenerateThumbnails.aspx","GenerateWindow");
//Set the current argument object to the new radWindow
generateWindow.Argument = currentWindow.Argument;
generateWindow.setUrl(generateWindow.get_NavigateUrl());
---------------------
Any help would be greatly appreciated.
Thanks,
Christian
I just observed a funny thing.
By replacing <asp:button> which is opening the RadWindow, with an HTML input button - it opens the window on the foreground. If I use <asp:Button> then it opens up in the background of the caller window.
Any clue?
-Piyush
Please, find the answers to your questions below:
- I was able to reproduce the difference you mention in the behavior of the standard asp button and the HTML input when opening RadWindow by clicking each of them. This behavior is related to browser specifics and not to the RadWindow control itself - you can get equal behavior in both cases if you set type="submit" for the HTML input button.
- To set the focus to a RadWindow you need to call its setActive method with a boolean argument set to true. Furthermore, you should set a little timeout, actually a time interval equal to 0 will also do the trick. Below you can find a sample code snippet demonstrating how the focus should be set:
function OpenSecondWindow() { var parentPage = GetRadWindow().BrowserWindow; var secondWnd = parentPage.radopen('http://www.google.com','RadWindow2'); setTimeout(function(){secondWnd.setActive(true);}, 0); }
Greetings,
Svetlina
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The problem is due to browser specifics and the way the browser handles the button's click event. To avoid the problem, just set a timeout when opening the second window. Actually, a timeout of 0ms will do the trick.
For your convenience I am attaching a sample demonstration project.
Regards,
Svetlina
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Setting the timeout got the opened radwindow on front but still it's not modal in respect to the radwindow that opened it.
I'm opening with an html image button, opening with a html input button gives no problem, the window opens on front (without any timeout trick) and modal.
Is there any way to get it modal with an image button calling it?
thank you
I tested opening two modal RadWindows with an image button on the main page and with image buttons on the main page and on the dialog. In both test projects the modality worked as expected as you can see from the attached projects.
Please, examine them and in case you need further assistance, open a new support ticket and send me a reproduction project (or modify mine) along with a detailed explanation of the reproduction steps and some screenshots. Once I have a better understanding on your scenario I will do my best to help.
Sincerely yours,
Svetlina
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I modified the files you sent and added a third page (Default3.aspx). The desired flow is:
User clicks image in Default.aspx to launch first modal window, Default2.aspx.
User clicks image in Default2.aspx to launch second modal window, Default3.aspx.
User fills out text box in Default3.aspx and clicks "Save" button.
Default3.aspx is dismissed and passes the text box value as an argument to Default2.aspx.
Default2.aspx populates its own text box with the value passed in from Default3.aspx.
However, since the RadWindow is actually declared in Default.aspx (which after much testing is apparently how you fixed the second modal window problem), and not Default2.aspx, OnClientClose is called from Default.aspx, and not Default2.aspx. Therefore Default2.aspx never gets the argument value...
Is there a way to keep the fix for the two modal windows and be able to pass an argument from Default3 to Default2?
Thanks,
Tye
var oWnd = GetRadWindowManager().getWindowByName("Properties");
oWnd.get_contentFrame().contentWindow.CallbackFunction(arg);
When the OnClientClose method of the root page is loaded, I simply pass the returned argument object back to the first dialog using the CallbackFunction method I defined.
Thanks,
Tye
I believe that this forum thread and the attached examples in it are exactly what you need.
Kind regards,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Object' cannot be converted to type 'Function'.
Parameter name: handler
In this function...
function Sys$EventHandlerList$addHandler(id, handler) {
/// <param name="id" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name:
"id", type: String},
{name:
"handler", type: Function}
]);
if (e) throw e;
Array.add(
this._getEvent(id, true), handler);
}
I reworked the project and reattached it to the current thread. Could you please check it and let me know whether it fits you requirement?
All the best,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.