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

window.radopen gives document.activeElement Unspecified error

8 Answers 162 Views
Window
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 11 Apr 2012, 11:12 PM
I'm nearly positive that when I updated last week to the latest hotfix (v 2012.1.403.30), that build broke part of my application. Previously I was running the Q1 2012 release ( v.2012.1.215.40) with no serous problems other than a minor issue which is why I upgraded to the hotfix. The hotfix did correct my minor issue with RadScheduler, but it apparently has caused a more serious issue, as described here:

I am opening a window (on double-click within various RadGrid cells) using this code:
function ShowTestForm() {
    var wnd = window.radopen("Test.aspx", "WindowName");
    wnd.setSize(900, 700);
    wnd.center();
    return false;
}

The form begins to load, but now it throws this error: 
Microsoft JScript runtime error: Unspecified error.

which originates from this line of code in the ScriptResource.axd file:

this._focused=(document.activeElement==this._textBoxElement)&&!this.isReadOnly();


If you highlight  "document.activeElement", it gives: Unspecified error.

"this._textBoxElement" evaluates to a telerik:RadDatePicker control, so as a test I removed the RadDatePicker, the error goes away! However, my form absoluately needs this and other RadDatePickers. I've simplied my Test.aspx form all the way down to just one single control, no javascript, no code behind, it loads no data. Just one RadDatePicker and yet it still throws this error.
But, if I set my application to "Startup" with Test.aspx, the page loads just fine. So the problem only occurs when I try and go to Test.aspx with a window.radopen.

Help. This error never happened before with previous quarterly releases, I'm surely positive the hotfix has broken this. But I need to use the hotfix for another part of my application, so I can't just rollback to Q1 2012. Is there something else that I can do or test to get this working? The problem also occurs with other types of controls, such as RadDateTimePicker, RadTextBox. But no problems with RadComboBox, that control seems to be ok on the form, no error is thrown.

Thank you.



8 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 Apr 2012, 04:03 PM
Hello David,

This is yet another bug in IE9 related to iframes - when you try to access the document.activeElement object in an page that is loaded in an iframe in the Sys.Application.Load event you get this error.

You can reproduce it with a very simple markup and no RadControls at all:
on the main page:
<iframe src="Default2.aspx" style="width: 500px; height: 500px;"></iframe>

and in Default2.aspx:
<form id="form1" runat="server"
<asp:ScriptManager ID="Scriptmanager1" runat="server" /> 
<script type="text/javascript"
    function getActiveElement() 
    
        //this will throw the Unspecified Error in IE9 
        var actEl = document.activeElement; 
        alert(actEl); 
        Sys.Application.remove_load(getActiveElement); 
    
    Sys.Application.add_load(getActiveElement); 
</script
</form>

Placing the following function in Default.aspx fixes the problem by providing a value to the activeElement object in time:
function fix() 
    document.documentElement.focus(); 
    Sys.Application.remove_load(fix); 
Sys.Application.add_load(fix);



What I would advise is that you either use this fix, or try the latest release (Q1 2012 SP1 which was released yesterday) and see if this helps as there have been some fixes with regard to this.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
David
Top achievements
Rank 1
answered on 12 Apr 2012, 07:32 PM
Q1 2012 SP1 - fixed the problem. You guys rock! Thank you so much!
0
James
Top achievements
Rank 1
answered on 09 Jul 2013, 03:15 PM
Marin - I'm hitting a show-stopper and this is the only similar post I found. I'm getting a javascript error in the following code:

var d=document.activeElement;
if(d&&d.tagName.toLowerCase()!="body"){var f=(!$telerik.isDescendant(this._contentElement,d)&&this._dockMode);
if(!(e._isPredefined)||f){e._focusedPageElement=d;

It blows up on d.tagName.  This started happening today after downloading Telerik.Web.UI 
2013.2.611.45 and VisualStudio 2012 Update 3.  We are using the RadMessageWindow on this page.  Any ideas?
Yours,
James S


0
Marin Bratanov
Telerik team
answered on 10 Jul 2013, 11:07 AM
Hello James,

The following KB article explains this problem and its resolutions: http://www.telerik.com/support/kb/aspnet-ajax/window/modal-radwindow-in-radwindow-in-ie9-and-ie10.aspx.
We have done some work on that and the Q2 2013 SP1 release (that should be out next week) should not throw this error, because we have attempted to trap the browser bug.
This fix should also be available in the LIB from yesterday so you can test it.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Joshua
Top achievements
Rank 1
answered on 16 Jul 2013, 06:30 PM
Where is the download for Q2 2013 SP1? I currently have v.2013.2.611.40.
0
Marin Bratanov
Telerik team
answered on 17 Jul 2013, 12:23 PM
Hello Joshua,

The Q2 2013 SP1 release is not live yet, but it should be available later today. It will be located in your account where the latest official release is always available.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Pankaj
Top achievements
Rank 1
answered on 10 Oct 2013, 01:34 PM
Hi telerik team,

I am using telerik
Version=2011.1.426.35

errrors--
SCRIPT5022: InvalidCharacterError 
SCRIPT5007: Unable to set property 'src' of undefined or null reference 
and got the error in IE9 or 10 can you provide any fix for this ASAP 


The code which i am using is--

</a><span><a href="javascript:;" onclick="return OpenWindow(0);">Request Demo</a>
</a><span><a href="javascript:;" onclick="return OpenWindow(1);">Watch vedio</a>

<telerik:RadWindowManager Behaviors="Close" ID="RadWindowManager" runat="server"
        VisibleStatusbar="false" VisibleOnPageLoad="false">
        <Windows>
            <telerik:RadWindow ID="winRequestDemo" VisibleOnPageLoad="false" Title="Request a Demo or more Information"
                NavigateUrl="~/PopupRequestDemo.aspx" runat="server" Width="850px" Height="640px"
                Modal="true" ReloadOnShow="true">
            </telerik:RadWindow>
            <telerik:RadWindow ID="winPopupVideoPlayer" VisibleOnPageLoad="false" Title="Product Video"
                NavigateUrl="~/PopupVideoPlayer.aspx" runat="server" Width="600px" Height="575px"
                Modal="true" ReloadOnShow="true">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>


<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function OpenWindow(windowIndex) {
                //get the current windows collection
                var manager = $find("<%=RadWindowManager.ClientID %>");
                var windows = manager.get_windows();
                var win = windows[windowIndex];

                if (!win.isVisible()) {
                    win.show();
                    win.center();
                }
                return false;
            }
        </script>
    </telerik:RadCodeBlock>

Thanks
Pankaj
0
Marin Bratanov
Telerik team
answered on 11 Oct 2013, 08:40 AM
Hello Pankaj,

Let's use your first thread to discuss this case: http://www.telerik.com/community/forums/aspnet-ajax/window/error-in-opening-rad-window.aspx.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Window
Asked by
David
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
David
Top achievements
Rank 1
James
Top achievements
Rank 1
Joshua
Top achievements
Rank 1
Pankaj
Top achievements
Rank 1
Share this question
or