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

Destroy the window object on close

3 Answers 215 Views
Window
This is a migrated thread and some comments may be shown as answers.
Venkata Rajesh
Top achievements
Rank 1
Venkata Rajesh asked on 02 Jul 2012, 03:14 PM
Hi

I have a radWindowManager i am using in a UserControl that opens another UserControl in the radWindowManager.

I am using the VisibleOnPageLoad property to set the window to visible on a button click. Now when i close the window it just becomes invisble. When i open it again using the button click the old values inside the window are preserved. However on each click the window should load fresh.

I tried to use the window.radWindow via javascript but it doesnt work and get an error about property not found.

How can i achieve the above?

Thanks in advance.

Rajesh

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Jul 2012, 07:59 AM
Hi Rajesh,

When you are using the ContentTemplate of the RadWindow you need to get a reference to it  via $find() as is explained in this online demo.

Regarding your question - the RadWindow is equivalent to an ASP Panel in this case and there simply isn't a method for resetting its content in the framework, so the RadWindow cannot do this automatically.  I believe this thread will shed more light on the case: http://www.telerik.com/community/forums/aspnet-ajax/window/radwindow-reload-every-time-it-opens.aspx.

To summarize it - in case you load an external page you can use its ReloadOnShow functionality - set the ReloadOnShow property to true and you can also set the ShowContentDuringLoad to false to prevent the display of old information until the new version of the page is loaded. In case you are using the ContentTemplate you would need to reset the form manually.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Venkata Rajesh
Top achievements
Rank 1
answered on 03 Jul 2012, 08:43 AM
Hi Marin,

Thanks for the reply. I am using ContentTemplate and would follow your advice to clear the form manually. Is there no other alternative that would help me achieve the clear of form. Also i am using the ShowContentDuringLoad, ReloadOnShow and DestroyOnClose properties but these dont have any effect.

Another scenario that i have is as given below:

I have a RadTabStrip that has 2 tabs : Tab1 and Tab2. 

Tab1 and Tab2 load the same user control "UserControlA" (different instances).

The "UserControlA" has a button that opens a RadWindowManager that has another user control "UserControlB". Now is there anyway that when the radWindow is opened from the respective RabPageView i can get the reference of the controls in "UserControlB" via Javascript so that i would not need to perform a PostBack.

Thanks in advance.

Rajesh
0
Marin Bratanov
Telerik team
answered on 03 Jul 2012, 08:52 AM
Hi Rajesh,

These three properties have effect only for pages inside the RadWindow. Please examine the information in the demo I linked for the difference between the two modes. When the contentTemplate is used the controls inside load on the page immediately, so these properties cannot have effect. On the matter of accessing controls inside - this is also shown in the demo and in this article. Generally the concept is the same as with any other INaming container. You may find useful jQuery to access them, e.g. as children of the RadWindowInstance.get_popupElement() by adding classes to them.


Greetings,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Venkata Rajesh
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Venkata Rajesh
Top achievements
Rank 1
Share this question
or