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

RadWindow Error Closing

6 Answers 112 Views
Window
This is a migrated thread and some comments may be shown as answers.
Keith Lusk
Top achievements
Rank 1
Keith Lusk asked on 17 Jun 2010, 01:11 AM
The following does not work:

function

 

 

CloseOnReload() {

 

GetRadWindow().Close();

}

 

 

function GetRadWindow() {

 

 

 

var oWindow = null;

 

 

 

if (window.radWindow) oWindow = window.radWindow;

 

 

 

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

 

 

 

return oWindow;

 

}



This is called by a CloseOnReload() script registered as a startup script when some action is performed.

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Jun 2010, 07:46 AM
Hi,

The code should be executed in the radwindow page as described in the documentation here.
Executing Script on a Reload

     If you want to close the window from parent page, then you need to access the window client object and invoke the close() method. Get the client object of window by using 'getWindowByName' method.


-Shinu.
0
Keith Lusk
Top achievements
Rank 1
answered on 17 Jun 2010, 04:53 PM
Hi,

First, thank you so much for your response. The radwindow is contained by the radwindow manager. I had to set

PreserveClientState

 

 

="true" on the manager in order to keep the window open when posting information from the window back to the server. The window is not accessing a separate page url, but is using a content template. When the done button (linkbutton) is clicked in the radwindow, if the page is valid, then I register the startup script to close the window. I have found that in the window show javascript function GetRadWindowManager() returns a reference to the radwindowmanager, but in the CloseOnReload, GetRadWindowManager returns null.

The getWindowByName or getWindowByID methods of the radwindowmanager will not work until I can get a reference to the RadWindowManager. I have looked at the source of the page  and have found the client ID of the radwindow manager = <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwmManager" style="display:none;"> and the client id of the radwindow(there is only one): <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwContentEditor" style="display:none;">.

The id of each is rwmManager and rwContentEditor. Why would GetRadWindowManager() not return the manager reference? Is there some other method that should be used in the Javascript?

Thanks
Keith

0
Svetlina Anati
Telerik team
answered on 18 Jun 2010, 03:28 PM
Hi Keith,

The GetRadWindow() function is used to reference a RadWindow from inside its content page. In your case, however, the RadWindow and its content are all on the same page - that is why you should simply reference it as you reference a client object on the same page - by using the $find method.


Best wishes,
Svetlina
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
0
Keith Lusk
Top achievements
Rank 1
answered on 18 Jun 2010, 07:10 PM
Hi Svetlina,

Thank you for the reply. That suggestion did not work. On the debug of the javascript for the CloseOnReload function, the following $finds:

var

 

 

oManager = $find("<%= rwmManager.ClientID %>");
oManager.closeall();
var oWnd = $find("<%= rwContentEditor.ClientID %>");

 

oWnd.close();

Both returned null references. Neither the Manager nor the Window could be found.

If I do a search on the source control for each -> The Manager:
<div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwmManager" style="display:none;">
And the window:
<div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwContentEditor" style="display:none;">

Are both on the page.

Thanks
Keith

0
Keith Lusk
Top achievements
Rank 1
answered on 22 Jun 2010, 05:37 PM
As previously stated, I still cannot get this window to close. See above
0
Georgi Tunev
Telerik team
answered on 24 Jun 2010, 09:16 AM
Hello Keith,

In such case, please open a support ticket and send us a small sample project / sample page(s) where this issue could be reproduced. This way we will get a better view over your exact setup and logic and we will provide you with a solution right away.

Thank you in advance for your cooperation.

Greetings,
Georgi Tunev
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
Tags
Window
Asked by
Keith Lusk
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Keith Lusk
Top achievements
Rank 1
Svetlina Anati
Telerik team
Georgi Tunev
Telerik team
Share this question
or