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

Opening a RadWindow from Within a RadWindow

8 Answers 220 Views
Window
This is a migrated thread and some comments may be shown as answers.
Craig Hinkel
Top achievements
Rank 1
Craig Hinkel asked on 06 Jan 2009, 03:16 PM
Hello,

I read the section on opening a radwindow from within a radwindow using the following:

 

function GetRadWindow()

 

{

 

var oWindow = null;

 

 

if (window.radWindow)

 

oWindow = window.radWindow;

 

else if (window.frameElement.radWindow)

 

oWindow = window.frameElement.radWindow;

 

return oWindow;

 

}

 

 

var oManager = GetRadWindow().get_windowManager();

 

oManager .radopen(

'something.aspx', null);

However, my problem is the radwindow launching the second radwindow's OnClientClose event is not being called anymore and I need this in order to look at the argument passed in and see if I need to refresh.

Thanks

 

 

 

8 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 07 Jan 2009, 11:47 AM
Hi Craig,

The code that you shows in your thread is OK and cannot be a reason for this problem. Since I am missing the rest of your logic however, I am afraid that I cannot be of much help.

Could you please open a support ticket and send me the parent page and the content page for the RadWindow from where you are opening the second one? I will check them and get back to you.


Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Craig Hinkel
Top achievements
Rank 1
answered on 07 Jan 2009, 01:14 PM
I forgot one more snipped of code. if you still need an example, let me know.

<

telerik:radwindowmanager id="RadWindowManager1" runat="server" Modal="true" Height="750" Width="1000" ReloadOnShow="true" Behaviors="close" OnClientClose="OnClientClose" Skin="WebBlue" />

 


 

function OnClientClose(radWindow)

 

{

 

if (radWindow.argument == "selected")

 

{

$find(

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("selected");

 

}

}

0
Shantnu Chaturvedi
Top achievements
Rank 1
answered on 07 Jan 2009, 02:29 PM
Dont you need to give

var oManager = GetRadWindow().get_windowManager();

oManager.open('something.aspx', null);

instead of:

var oManager = GetRadWindow().get_windowManager();

oManager.radopen('something.aspx', null);


is your 'radOpen' function working here as it is giving me an error?

oManager.(

0
Craig Hinkel
Top achievements
Rank 1
answered on 07 Jan 2009, 02:33 PM
sorry, that is a typo. everything works fine, accept the OnClientClose method is not being called.
0
Shantnu Chaturvedi
Top achievements
Rank 1
answered on 07 Jan 2009, 02:43 PM
I am having the same problem except I am getting different error.

I have Main Window, nested-radWindow1 and then nested-radWindow2 (called from nested-radWindow1).
The nested nested-radWindow2 runs fine but on close gives error:

--> "telerik Can't execute code from a freed script"



0
Craig Hinkel
Top achievements
Rank 1
answered on 07 Jan 2009, 03:19 PM
i think im on to something here. I am using the following code in my second radwindow and the only problem here is add_close gets called multiple times everytime the radwindow is shown, so the method is called multiple times on close. is there a way to know if the method is already attached to the window?

 

var oManager = GetRadWindow().get_windowManager();

 

 

var oWindow = oManager.GetWindowByName("wndUserSearch");

 

 

oWindow.setUrl(

"test");

 

oWindow.add_close(OnClientClose);

oWindow.show();

0
Georgi Tunev
Telerik team
answered on 08 Jan 2009, 03:05 PM
Hello Craig,

This behavior is expected - every time you open a window, you add the closing function to be executed. You need to either remove the previous one before adding it, or to remove it in the OnClientClose function.
e.g.

oWindow.remove_close(OnClientClose);

oWindow.add_close(OnClientClose);


Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Craig Hinkel
Top achievements
Rank 1
answered on 08 Jan 2009, 03:07 PM
perfect, that's what i thought, i just didn't see a remove method in the doucmentation.

thanks
Tags
Window
Asked by
Craig Hinkel
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Craig Hinkel
Top achievements
Rank 1
Shantnu Chaturvedi
Top achievements
Rank 1
Share this question
or