Caption/title disappearing in non-IE browsers

5 posts, 1 answers
  1. topry
    topry avatar
    32 posts
    Member since:
    Oct 2008

    Posted 26 May 2009 Link to this post

    I've tested under IE6, 7, 8, without issues.
    However under current Windows releases of Chrome and Safari, the radWindow title appears for a moment when the window is created and then immediately disappears after the passed form is loaded.

    The simplest example:

    var wnd = radopen("MyDialog.aspx?", null);  
    wnd.set_title("My RadWindow Caption");  
     
    I've also tested with RadWindow using:
    var oWnd = $find("<%= RadWindow1.ClientID %>");  
    oWnd.set_title("My Dialog Title"); 

    with same results.
    However, if I pass a URL (http://www.telerik.com) vs a relative webform, the caption is not cleared.
  2. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 29 May 2009 Link to this post

    Hello Topry,

    This behavior is expected - RadWindow will automatically pick the title of the content page if it is from the same domain as the parent page. You can override that behavior by using one of the following approaches :
    • set the title in the page load event of the RadWindow as follows :
      <script type="text/javascript"
          function windowLoad(oWindow, args) 
          { 
              oWindow.set_title("New title"); 
          } 
          function openWindow() 
          { 
              var oWindow = radopen("Popup.aspx""RadWindow1"); 
              oWindow.remove_pageLoad(windowLoad); 
              oWindow.add_pageLoad(windowLoad); 
          } 
      </script> 
    • set the desired value between the <title> tag on the content page. That value will be used as a value of the RadWindow's title


    I hope this helps.

    Kind regards,
    Fiko
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. topry
    topry avatar
    32 posts
    Member since:
    Oct 2008

    Posted 29 May 2009 Link to this post

    Thanks, that resolves it for me - I must have missed it in the docs.
  5. Karen
    Karen avatar
    27 posts
    Member since:
    Jul 2008

    Posted 09 Oct 2009 Link to this post

    Hello, your approach works if the title is static, but what if the title is passed to openWindow(title) method? How to forward it to windowLoad method?

    Thanks.
     
  6. Karen
    Karen avatar
    27 posts
    Member since:
    Jul 2008

    Posted 09 Oct 2009 Link to this post

    Never mind I found a solution

    <script type="text/javascript"
        function windowLoad(oWindow, args) { 
            oWindow.set_title(oWindow.argument); 
        } 
        function openWindow(title) { 
            var oWindow = radopen("Popup.aspx""RadWindow1"); 
            oWindow.argument = title; 
            oWindow.remove_pageLoad(windowLoad); 
            oWindow.add_pageLoad(windowLoad); 
        }  
    </script>  

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017