This is a migrated thread and some comments may be shown as answers.

JavaScript RadOpen Error

8 Answers 399 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kyle Schiele
Top achievements
Rank 1
Kyle Schiele asked on 03 Nov 2007, 01:26 PM
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

8 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Nov 2007, 08:55 AM
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
0
Kyle Schiele
Top achievements
Rank 1
answered on 05 Nov 2007, 09:18 AM

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

0
Georgi Tunev
Telerik team
answered on 05 Nov 2007, 09:31 AM
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
0
Jeff
Top achievements
Rank 1
answered on 23 Apr 2008, 09:20 AM
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>

0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 24 Apr 2008, 02:53 PM
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();
......
}

0
Jeff
Top achievements
Rank 1
answered on 24 Apr 2008, 08:50 PM
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");

0
Svetlina Anati
Telerik team
answered on 25 Apr 2008, 11:15 AM
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
0
Deepak Zala
Top achievements
Rank 1
answered on 13 Aug 2010, 02:14 PM

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?

Tags
Window
Asked by
Kyle Schiele
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Kyle Schiele
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Obi-Wan Kenobi
Top achievements
Rank 1
Svetlina Anati
Telerik team
Deepak Zala
Top achievements
Rank 1
Share this question
or