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

Purpose of ReloadOnShow?

6 Answers 707 Views
Window
This is a migrated thread and some comments may be shown as answers.
Fooberichu
Top achievements
Rank 2
Fooberichu asked on 27 Dec 2007, 09:18 PM
I'm just trying to understand what the purpose of ReloadOnShow is for... anybody want to help enlighten me?  In my instance, I am using a javascript method to call the RadWindow as such (example taken from the RadScheduler external edit example):

window.radopen("/dnndev/DesktopModules/MACU.Calendar/EventDetails.aspx?TabId=59&ItemId=" + apt.ID + "&Instance=" + start, "AdvancedForm");

So that reloads it everytime anyway... but maybe I'm just missing the point somewhere.  Since I have a lot of future uses I plan on doing with this, I'd really like to understand where/why I'd use that property.

Thanks in advance.

6 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Dec 2007, 09:15 AM
Hello Fooberichu,

Generally speaking by design the RadWindow caches its content. In cases where you show the same dialog window but with different content (for example a dynamically changing page), you can use this property to ensure that when the RadWindow dialog is opened, you will get the most recent version of that page. If you control the content of the page via the query string as in your case, this property is not needed.




Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Matt Francis
Top achievements
Rank 1
answered on 02 Jan 2008, 07:52 PM
I have found that if the Reload is turned on, it will hit the window page twice for some reason (not desired).  If you turn the Reload off though, it will never show the updated page if you are reusing the same window.  So far, what seems to work best is to add a random number into the url so the window does not use a cached version (see below).  It will only hit the page once, and will also actually display the new page.  In my case, without the random number, the url would have been the same, even though the generated page could have changed.  If anyone has a better idea, please let me know.

Client function code:

// Need a random item in the querystring so the RadWindow does not pull from cache.

var WinId = "Win" + Math.random().toString();
var Url = "query_preview.aspx?id=" + elReportSavedQueryID.value + "&wid=" + WinId;
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("ExportPreviewWindow");

if (!oWnd){
    alert(
"No window object found!");
    return;
}

oWnd.SetUrl(Url);
oWnd.Show();

Window Manager in page:

<radw:radwindowmanager id="RadWindowManager1" runat="server" left="" navigateurl="" skinspath="~/RadControls/Window/Skins" title="" top="">
<Windows>
<radW:RadWindow ID="ExportPreviewWindow" DestroyOnClose="false" Modal="true" EnableViewState="False" VisibleStatusbar="true" Width="600px" Height="400px" NavigateUrl="" />
</Windows>
</radw:radwindowmanager>


 

0
Fooberichu
Top achievements
Rank 2
answered on 02 Jan 2008, 08:45 PM
Thanks for the comment on that -- I had noticed some strangeness where passing the same ID to it didn't always refresh the page.  I'll have to add a random # as well though in *most* cases people won't be opening up the page with the same parameters more than once (ever).

I definitely agree that having the ReloadOnShow firing the OnLoad twice is not very desirable at all so I think your solution seems viable enough.

Thanks again for the advice on that.
0
Kirill
Top achievements
Rank 1
answered on 05 Dec 2008, 03:39 PM
Thanks for your tip with random number.

I also experienced issue with loading window twice when ReloadOnShow is turned on.
But your workaround helped.



0
satish
Top achievements
Rank 1
answered on 24 Mar 2009, 03:32 PM
Thanks its helps me


0
Roger
Top achievements
Rank 1
answered on 15 Apr 2009, 12:43 AM
Hi,
thanks for that...I have 2 radwindows opening in modal. Of course, after reading your solution I now know why my first window reloaded after the second window closed...it was "ReloadOnShow=true" plus the cache. I would be nice to be able to turn the cache off but at least through your investigation I have a fix.

You've saved me hours of debugging.

Regards
Roger
Tags
Window
Asked by
Fooberichu
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Matt Francis
Top achievements
Rank 1
Fooberichu
Top achievements
Rank 2
Kirill
Top achievements
Rank 1
satish
Top achievements
Rank 1
Roger
Top achievements
Rank 1
Share this question
or