radcontextmenu and radwindow

3 posts, 0 answers
  1. jorge
    jorge avatar
    23 posts
    Member since:
    Apr 2007

    Posted 17 Apr 2009 Link to this post

    There seems to be some kind of problem when using a radwindow as a response to a contextmenu item click.  Once you click on the menu item, you get a javascript error, 'type' is null or not an object, in a dynamic Telerik.Web.UI code.  This is on Q1 2009.

    Here is a very simple page to reproduce the issue:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> 
     
    <!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>  
        <script language="javascript" type="text/javascript">  
     
            function onClicking(sender, eventArgs) {  
                var item = eventArgs.get_item();  
     
                var oManager = GetRadWindowManager();  
                var navigateUrl = item.get_navigateUrl();  
     
                eventArgs.set_cancel(true);  
     
                if (navigateUrl && navigateUrl != "#") {  
                    oManager.open(navigateUrl, "document");  
     
                }  
            }  
     
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <div> 
            <telerik:RadContextMenu ID="RadContextMenu1" runat="server" OnClientItemClicking="onClicking">  
            <Targets> 
                <telerik:ContextMenuDocumentTarget /> 
            </Targets> 
            <Items> 
                <telerik:RadMenuItem Text="Documents">  
                    <Items> 
                        <telerik:RadMenuItem Text="Item 1" NavigateUrl="documents/Sample/Sample%20Lease%20Document%202008.pdf">  
                        </telerik:RadMenuItem> 
                        <telerik:RadMenuItem Text="Item 2">  
                        </telerik:RadMenuItem> 
                    </Items> 
                </telerik:RadMenuItem> 
            </Items> 
            </telerik:RadContextMenu>     
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
            </telerik:RadWindowManager> 
        </div> 
        </form> 
    </body> 
    </html> 
     
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Apr 2009 Link to this post

    Hi Jorge,

    Give a try with radopen() method in order to open RadWindow instead of oManager.open() and see whether it helps.

    [JavaScript]
     
    <script language="javascript" type="text/javascript"
    function onClicking(sender, eventArgs)  
    {   
        var item = eventArgs.get_item();  
        var navigateUrl = item.get_navigateUrl(); 
        eventArgs.set_cancel(true); 
        if (navigateUrl && navigateUrl != "#")  
        {   
            var oWnd  = radopen(navigateUrl, "document"); 
        }   
    </script>  

    You can also refer following link for several functions that let you to open a RadWindow.
    Opening Windows

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jorge
    jorge avatar
    23 posts
    Member since:
    Apr 2007

    Posted 21 Apr 2009 Link to this post

    Shinu,

    No difference.  Some additional information, the menu remains open, and if you continue through the error, it will generate the error again if the cursor hovers over the window.

    Jorge
Back to Top