open radwindow from a radwindow

7 posts, 0 answers
  1. rtk
    rtk avatar
    46 posts
    Member since:
    Aug 2006

    Posted 13 Jan 2009 Link to this post

    Hey

    I have 3 pages(masterpage, listTask, editTask)
    masterpage
        - listTask
               - editTask

    When i click a task in listTask.aspx, editTask.aspx open in a radWindow.
    I would like top open a new radwindow from inside the opened radwindow(editTask), but i don't want the new window to appear inside the allready opened window.

    Now i have the radWindowManager in the masterpage, and i can access this from the contentpage. But i can not access this windowmanager from the open window.

    Hope someone can help me with this problem




     
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 13 Jan 2009 Link to this post

    Hi brajoh,

    Please check the following documentation article - I believe it will be of help:

    http://www.telerik.com/help/aspnet-ajax/window_programmingopeningfromwithin.html



    All the best,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Raymond Mui
    Raymond Mui avatar
    54 posts
    Member since:
    Apr 2008

    Posted 27 Apr 2009 Link to this post

    I have the same problem.  Following the article in http://www.telerik.com/help/aspnet-ajax/window_programmingopeningfromwithin.html did not help.  The radwindow did not "recgonise" the radwindow manager in the master page.
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Apr 2009 Link to this post

    Hello Raymond,

    I prepared a working demo based on the information that is on the link provided by Georgi Tunev. Please find it attached.

    I hope this helps.

    Best wishes,
    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.
  5. Raymond Mui
    Raymond Mui avatar
    54 posts
    Member since:
    Apr 2008

    Posted 28 Apr 2009 Link to this post

    Hi,

    I tried your demo, it works.  But in my case, it doesn't.

    My original javascript:

        function showMessageWindow() {
         // open the default error radwindow
         var oBrowserWnd = GetRadWindow().BrowserWindow;
         var w = oBrowserWnd.radopen('/Common/RadWindows/MessageWindow.aspx', 'rwMessageWindow');
         w.setSize(400, 300);
        }

    The above works.

    If i change as follows:

        function showMessageWindow() {
         // open the default error radwindow
         var parentWindow = GetRadWindow().get_windowManager();
         var oWindow = parentWindow.open('/common/RadWindows/MessageWindow.aspx', 'rwMessageWindow');
         oWindow.setSize(400, 300);
        }

    It doesn't work, with the following error:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Wed, 29 Apr 2009 02:58:16 UTC

    Message: 'undefined' is null or not an object
    Line: 70
    Char: 6
    Code: 0
    URI: http://local.intranet/functions/intranetadmin/countrysettings/Edit.aspx?cc=NEW

     

  6. Raymond Mui
    Raymond Mui avatar
    54 posts
    Member since:
    Apr 2008

    Posted 28 Apr 2009 Link to this post

    I have created the similar pages:

    1) MasterPage:

    <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="Test_MasterPage" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title></title>  
        <asp:ContentPlaceHolder ID="head" runat="server">  
        </asp:ContentPlaceHolder> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <div> 
                master page  
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
                </telerik:RadScriptManager> 
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
                </telerik:RadWindowManager> 
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
                </asp:ContentPlaceHolder> 
            </div> 
        </form> 
    </body> 
    </html> 


    2) Default.aspx

     

    <%@ Page Title="" Language="VB" MasterPageFile="~/Test/MasterPage.master" 
        AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="Test_default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">  
    </asp:Content> 
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">  
     
        <script type="text/javascript">  
            function openRadWindow() {  
                var oWindow = radopen('http://www.google.com', 'abc');  
                oWindow.setSize(500, 500);  
                oWindow.center;  
            }  
        </script> 
     
        <h5> 
            here the content page</h5> 
        <asp:LinkButton ID="lnkOpenClientClick" Text="click here to open dialog - onclientclick" 
            runat="server" OnClientClick="openRadWindow();return false" /> 
        <br /> 
        <br /> 

        <asp:LinkButton ID="lnkOpenServer" Text="click here to open dialog - server response" 
            runat="server" /> 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
     
            <script type="text/javascript">  
                    <%=_scriptToRun%> 
            </script> 
     
        </telerik:RadCodeBlock> 
    </asp:Content> 

    3) Default.aspx.vb

    Partial Class Test_default  
        Inherits System.Web.UI.Page  
     
        Public _scriptToRun As String  
     
     
        Protected Sub lnkOpenServer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkOpenServer.Click  
            _scriptToRun = "openRadWindow();" 
     
        End Sub  
    End Class  
     

    You can see that there are two buttons, one using OnClientClick, one using server postback.  The former one works as your demo.  However, if I run the latter one, it doesn't work, and comes up with error.

    I want to use the second method (server postback) because I need to verify something before i popup the window.

    Thanks

    Raymond

  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 29 Apr 2009 Link to this post

    Hi Raymond,

    About the showMessageWindow function :
    This error may be caused if you open a first RadWindow outside of the RadWindowManager and its get_windowManager() function returns 'null' respectively.
    In your case, you need to declare the first opened RadWindow inside the <window> collection of the windowmanager as follows :

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        <Windows> 
            <telerik:RadWindow ID="RadWindow1" runat="server"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

    As alternative, also, you can open the first window by using the radopen() function (I recommend that approach). This function creates and opens a new window (if the window already exists, it will not be created) and adds it to the window collection automatically( if it does not exist in the collection). In this case I recommend you remove the first RadWindow declaration from the page or move it in the window collection of the RadWindowManager.

    In reference to the second question : More details about opening the RadWindow from codebehind and full working demos can be found on this KB article.

    I hope this helps.

    Greetings,
    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.
Back to Top