Radwindow seturl and show

3 posts, 0 answers
  1. Roger
    Roger avatar
    38 posts
    Member since:
    May 2008

    Posted 06 May 2009 Link to this post


    I'm using the below function to show a window, but the code for the pages that I'm showing is being executed twice
    once with seturl and once with show.
    What am I doing wrong to cause this?

    If i remove the oWnd.Show() my window opens with the URL page being executed, but you can't close the window.

    function OpenFeatureWindow(URL) {  
    try {  
        var oWnd = $find("<%= Features.ClientID %>");  
        oWnd.set_height(document.documentElement.clientHeight - 75);  
        oWnd.set_width(document.documentElement.clientWidth - 50);  
        oWnd.center();  
        oWnd.Show(); 
        } catch (e) 
        {  
        alert(e); 
    }  
    }  
     

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default" 
            InitialBehavior="None" EnableViewState="true" DestroyOnClose="true">  
            <Windows> 
                <telerik:RadWindow runat="server" Behavior="Close" InitialBehavior="None" Left="" 
                    Top="" ID="Features" Behaviors="Close, Resize, Maximize, Move" Height="400" Modal="True" 
                    VisibleStatusbar="false" Width="1000px" DestroyOnClose="false" ShowContentDuringLoad="true" 
                    ReloadOnShow="True" OnClientClose="ClearWindow" Animation="None" NavigateUrl="">  
                </telerik:RadWindow> 
            </Windows> 
        </telerik:RadWindowManager> 

    Modified approach, which seems to work very well, however, I do not want the statusbar to be visible, not finding a way to hide it totally, I set it to "" as shown, but this causes the page title to be cleared as well, when the page title is set in code behind on the URL pages, me.title = "xyz", xyz does not show in the title.

    I'd really like to use this approach, but I don't want to see the statusbar at all, and I don't want to loose my titles.

    Suggestions

    function OpenFeatureWindow(URL) {  
     
                    try {  
                        var oWnd = radopen(URL, null);     
                        oWnd.set_height(document.documentElement.clientHeight - 75);  
                        oWnd.set_width(document.documentElement.clientWidth - 50);  
                        oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize + Telerik.Web.UI.WindowBehaviors.Maximize + Telerik.Web.UI.WindowBehaviors.Move)  
                        oWnd.center();  
                        oWnd.set_status = "" 
                    } catch (e) {  
                        alert(e);  
                    }  
                } 

  2. Roger
    Roger avatar
    38 posts
    Member since:
    May 2008

    Posted 06 May 2009 Link to this post

    It seems that in order to NOT loose my title, but clear the statusbar I needed to use

     

    oWnd.add_pageLoad(

    function() { oWnd.set_status(" "); });

    Which, clears the url from the status bar, and leaves my titles alone.

    But that doesn't explain why my original approach was causing the pages to be executed twice

     

  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 May 2009 Link to this post

    Hello Roger,

    You have set ReloadOnShow to true - that is why the page loads again. As for setting the title, please make sure that the page you are loading in the RadWindow doesn't have a <title></title> in its head section. If it is, RadWindow will display that title instead.

    I hope this helps. If you still experience problems, please open a support ticket and send me the following:
    1. Small sample project where I can reproduce the problems that you experience.
    2. Detailed description of the desired behavior.
    I will check the project and modify it for you so it works as expected.
    All the best,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top