Purpose of ReloadOnShow?

7 posts, 0 answers
  1. Fooberichu
    Fooberichu avatar
    44 posts
    Member since:
    Oct 2007

    Posted 27 Dec 2007 Link to this post

    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.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Dec 2007 Link to this post

    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
  3. Matt Francis
    Matt Francis avatar
    16 posts
    Member since:
    Oct 2002

    Posted 02 Jan 2008 Link to this post

    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>


     

  4. Fooberichu
    Fooberichu avatar
    44 posts
    Member since:
    Oct 2007

    Posted 02 Jan 2008 Link to this post

    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.
  5. Kirill
    Kirill avatar
    4 posts
    Member since:
    Dec 2008

    Posted 05 Dec 2008 Link to this post

    Thanks for your tip with random number.

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



  6. satish
    satish avatar
    12 posts
    Member since:
    Mar 2009

    Posted 24 Mar 2009 Link to this post

    Thanks its helps me


  7. Roger
    Roger avatar
    183 posts
    Member since:
    Sep 2007

    Posted 14 Apr 2009 Link to this post

    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
Back to Top