JavaScript RadOpen Error

9 posts, 0 answers
  1. Kyle Schiele
    Kyle Schiele avatar
    20 posts
    Member since:
    Aug 2012

    Posted 03 Nov 2007 Link to this post

    I am un sure why I am getting this javascript error when trying to use the radopen java script functionality:

    Error: Object doesn't support this property or method.

    This sample code produces the error:

    <head runat="server">

    <title>Test Page</title>

    <script>

    function openWindow()

    {

    alert("openWindow Activated");

    var oWnd = window.radopen("http://www.yahoo.ca", "RadWindow1");

    }

    </script>

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    &nbsp;</div>

    <asp:ScriptManager ID="ScriptManager1" runat="server">

    </asp:ScriptManager>

    <telerik:RadWindow ID="RadWindow1" runat="server">

    </telerik:RadWindow>

    <button onclick="openWindow();return false;" class="Button" style="WIDTH:190px">

    Show window (using radopen)

    </button>

    </form>

    </body>

    </html>


    Kyle

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 05 Nov 2007 Link to this post

    Hi Kyle,

    radopen(), radconfirm(), radprompt() and radalert() functions are only available via RadWindowManager - it must be present on the page. If you want to open a single RadWindow which is declared on the page, you need to reference it first with ASP.NET AJAX's $find() method and then call show().

    e.g.

    var oWnd = $find("RadWindow1");
    oWnd.setUrl("http://www.yahoo.ca");
    oWnd.show();






    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Kyle Schiele
    Kyle Schiele avatar
    20 posts
    Member since:
    Aug 2012

    Posted 05 Nov 2007 Link to this post

    Thanks Georgi,

    Thanks for answering my question, I think the reason this is occurring is the documentation of the client side api does not reflect the need for RadWindowManager in reference to using Radwindow.open. It may be useful if the approach you suggested be placed in the documentation.

    Doc Location:

    RadControls 'Prometheus' for ASP.NET Q2 2007 Send comments on this topic.

    Window Open
    Controls > RadWindow > RadWindow Client-Side > Examples > Window Open

    Kyle Schiele

  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 05 Nov 2007 Link to this post

    Hello Kyle,

    Indeed, you are right. We are constantly improving the "Prometheus" documentation and we will add this information there as well.




    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Jeff
    Jeff avatar
    17 posts
    Member since:
    Apr 2008

    Posted 23 Apr 2008 Link to this post

    I have the RadWindowmanager on  the page and I am still getting the error:

    Object doesn't support this property or method.


    Here is the code.

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Web20">

    <Windows>

    <telerik:RadWindow Skin="Vista" ID="RadWindowZ" runat="server" Title="Change Location" Height="200px"

    Width="400px" OnClientClose="OnClientClose" VisibleStatusbar="false" Modal="true"

    />

    </Windows>

    </telerik:RadWindowManager>

    <

    script type="text/javascript">

    function

    displayit(sender, eventArgs)

    {

    var item = eventArgs.get_item();

    if (item.get_text() == "Change Location")

    {

    var oWindow = window.radopen("ChangeLocation.aspx","RadWindowZ");

    }

    }

    function

    OnClientClose(radWindow)

    {

    if (radWindow.argument) location.reload(true);

    }

    </

    script>

  6. Obi-Wan Kenobi
    Obi-Wan Kenobi  avatar
    460 posts
    Member since:
    Aug 2007

    Posted 24 Apr 2008 Link to this post

    Probably the error is on this line: 
    var item = eventArgs.get_item();
    because such a method do not exists for eventArgs.
    I take a look at your code and I think that you want to get the Radwindow title.
    You can get the Radwindow title on this way:

    function

    displayit(sender, eventArgs)
    {
        var wintitle = sender.get_title();
    ......
    }

  7. Jeff
    Jeff avatar
    17 posts
    Member since:
    Apr 2008

    Posted 24 Apr 2008 Link to this post

    No, the error is not on that line. This function is being called from the onclientitemclicked of the radmenu...which does have that method in the event args. This line is working fine.

    The error is coming from this line:

    var oWindow = window.radopen("ChangeLocation.aspx","RadWindowZ");

  8. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 25 Apr 2008 Link to this post

    Hi Jeff,

    One possible reason for this problem could be that you call radopen before the RadWindowManager has been rendered on the page. Make sure that the RadWindowManager is already rendered before calling the radopen function. One possible solution is to test the project with a little timeout added.

    In case  this does not help, please, open a new support ticket and send us a sample project which reproduces the issue.


    Best wishes,
    Svetlina
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Deepak Zala
    Deepak Zala avatar
    1 posts
    Member since:
    Aug 2009

    Posted 13 Aug 2010 Link to this post

    var

     

    wnd = $find("RadWin");

     

     

    wnd = window.radopen(

     

    "default.aspx", null); // even radopen is not showing in intellesens manager. it gives error if written forcefully

     

    wnd.setBounds($telerik.getBounds($get(

     

    "divCenterColumn"))); // even setBounds is not showing in intellesens manager. it gives error if written forcefully

    wnd.set_visibleTitlebar(
    false);

     

    wnd.set_visibleStatusbar(

     

    false);

     

    $addHandler(window,

     

    "resize", function() { wnd.setBounds($telerik.getBounds($get("divCenterColumn"))); });

     

    am I missing anything?

Back to Top