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

Microsoft JScript runtime error: 'null' is null or not an object

9 Answers 189 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniel Plomp
Top achievements
Rank 2
Daniel Plomp asked on 24 Mar 2010, 10:58 AM
Hi all,

Have a question about multiple RadWindows on one page that I try to open client-side.

These are my windows defined on my page:
<telerik:RadWindowManager ID="windowManager" runat="server"
        <Windows> 
            <telerik:RadWindow Skin="Sitefinity" InitialBehaviors="None" VisibleStatusbar="false" 
                Width="650px" Height="725px" Behaviors="Close" ID="wdKitchenSetup" runat="server" 
                Modal="true" Overlay="false"
            </telerik:RadWindow> 
            <telerik:RadWindow Skin="Sitefinity" InitialBehaviors="None" Visible="false" Width="400px" 
                Height="400px" Behaviors="Close" ID="wdWashupSetup" runat="server" Modal="true" Overlay="false"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

These are the js functions I use.
The ShowKitchenSetup is working okay. It shows a popup with the content of the referred url.
The ShowWashupSetup gives an error. (see thread title)

function ShowWashupSetup(id) { 
 
                // Define the ajaxManager 
                var ajaxPanel = $find("<%= ajaxPanel.ClientID %>"); 
 
                // Concat the arguments 
                var arguments = "Washup, " + id; 
 
                // Execute the ajax request 
                ajaxPanel.ajaxRequest(arguments); 
 
                // Define the window manager 
                var manager = GetRadWindowManager(); 
 
                // Define the url with parameters 
                var url = "ConfigWashup.aspx?id=" + id; 
 
                // Get the window 
                var wnd = manager.getWindowByName("wdWashupSetup"); 
 
                // Set the url 
                wnd.setUrl(url); 
 
                // Show the window 
                wnd.show(); 
 
            } 
 
            function ShowKitchenSetup(id) { 
 
                // Define the ajaxManager 
                var ajaxPanel = $find("<%= ajaxPanel.ClientID %>"); 
 
                // Concat the arguments 
                var arguments = "KitchenSetup, " + id; 
 
                // Execute the ajax request 
                ajaxPanel.ajaxRequest(arguments); 
 
                // Define the window manager 
                var manager = GetRadWindowManager(); 
 
                // Define the url with parameters 
                var url = "ConfigKitchen.aspx?id=" + id; 
 
                // Get the window 
                var wnd = manager.getWindowByName("wdKitchenSetup"); 
 
                // Set the url 
                wnd.setUrl(url); 
 
                // Show the window 
                wnd.show(); 
            } 

Anyone has an idea why this won't work?

Thanks,
Daniel

9 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 24 Mar 2010, 01:49 PM
Hello Daniel,

The code looks OK so I assume that the reason for the problem might be in the setup that you are using. Please open a support ticket and send us a small sample project where this issue could be reproduced - we will check it right away and get back to you with a solution.


Regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Plomp
Top achievements
Rank 2
answered on 25 Mar 2010, 09:06 AM
Hi Georgi,

I've created the support ticket, so hope to hear from you!

Thanks,
Daniel
0
Georgi Tunev
Telerik team
answered on 25 Mar 2010, 10:19 AM
Hello Daniel,

First of all I would like to apologize - I was reviewing the forum posts and I just noticed that I missed the problem in your code.
The reason for the problem is that in the second RadWindow (the one that throws the error) you have set Visible=false. When Visible is set to false, the control will not be rendered on the page at all and that is why you cannot "find" it in the JavaScript code. Remove that property (its default value is true) and all will work as expected.


Greetings,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Plomp
Top achievements
Rank 2
answered on 25 Mar 2010, 10:26 AM
Hi Georgi,

How stupid NOT to see that! :)
Thanks for the reply and solution!

-Daniel-
0
Subhash
Top achievements
Rank 1
answered on 04 Nov 2011, 11:06 AM
Hi,

I am using telrik RadGrid when I am doing shorting it will give me Bug like "Microsoft JScript runtime error: 'null' is null or not an object".

Please shortout this issue.

Thanks & Regards
Subhash Sharma
subhashuppdha@gmail.com

0
Marin Bratanov
Telerik team
answered on 04 Nov 2011, 05:17 PM
Hi Subhash,

If this issue is related to the RadWindow please examine the following sticky thread on opening if from the server: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx. The important part is the utilization of the Sys.Application.Load event to ensure the controls are loaded before trying to access them. More information on that is available here.

If this issue comes from the sorting of the grid alone please post your question in the respective forum, as there are more people there that this will relate to.


Best wishes,
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
Subhash
Top achievements
Rank 1
answered on 07 Nov 2011, 10:00 AM
Hi Marin ,

Thanks for your reply.
I am facing the problem when click on telerik:RadGrid Header for the sorting, When first time clicking on the telrik:Radgrid its showing me the error and second time sorting work properly.
Please give me the suitable answer why I am facing this problem.

Thanks & Regards
Subhash Sharma
0
Shinu
Top achievements
Rank 2
answered on 08 Nov 2011, 06:22 AM
Hello Subhash,

Please make sure that you are binding the Grid using Advanced DataBinding. If you are using any advanced feature in grid(like sorting), then a better approach is binding RadGrid using "AdvancedData binding" using NeedDataSource event.

For more information about this can be available here.
Advanced Data-binding (using NeedDataSource event).
Grid / Advanced Data Binding.

Thanks,
Shinu.
0
Subhash
Top achievements
Rank 1
answered on 08 Nov 2011, 12:43 PM
Hi Shinu,

I am using Update panel  and doing table row visiblility  "style="display: none"" and when I am doing the Table Row "style="display: block""  then working fine otherwise its give me exception..

I have alerady remove the update panel but its give me exception and when I reomve "style="display: none"" .working fine....
Is any issue to using "style="display: none"" , When using the Telrik:RadGrid.

Thanks & Regards
Subhash Sharma
Tags
Window
Asked by
Daniel Plomp
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Daniel Plomp
Top achievements
Rank 2
Subhash
Top achievements
Rank 1
Marin Bratanov
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or