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

Double Click Load On Demand Node

4 Answers 94 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ingo Buck
Top achievements
Rank 1
Ingo Buck asked on 09 Mar 2009, 05:07 PM
Hi,

if I double click a WebService-Load-On-Demand RADTreeNode while expanding is "on going" (Loading...) I get a browser error message:
'get_element()' is null or not an object. Line 5360.
IE6 and IE7

I use RadControls for ASPNET AJAX Q3 2008.

Any ideas?

Thanks in Advance.

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 10 Mar 2009, 08:39 AM
Hello Ingo Buck,

I could not reproduce the problem on our online demo. Can you?

Also, you might find this troubleshooting article useful:
Double Loading... message when you expand node fast

Kind regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ingo Buck
Top achievements
Rank 1
answered on 10 Mar 2009, 12:39 PM
Hi.

No, I can not reproduce. Its too fast.
I think some more details are important.
1. My Webservice-Request is busy enough to be able to double-click it twice or more. Or double-click other nodes in-between.
2. The TreeView is child of an UpdatePanel.
3. In the OnNodeClick-Event details are opened in another UpdatePanel.

I already used the javascript of the article mentioned above.
If you act as a click-monkey, as the customer did to find the error, it ends up in the mess, that the nodes are expanded, but not really expanded and keep in that dead state until pressing the browser refresh button. And it does not fix the problem. So I removed it again :)

I guess it has something to do with a retriggered AJAX web request. The response of the first one does not find its target node anymore.

You may include a sleep in the WebMethod of about 500-1000ms to be able to click more than once before responding.

Kind regards,
Ingo Buck
0
Veselin Vasilev
Telerik team
answered on 13 Mar 2009, 10:00 AM
Hi Ingo Buck,

You can use this alternative solution:

1. Subscribe to OnClientNodeExpanded and disable the treeview in its handler:

function OnClientNodeExpandedHandler(sender, e) 
    sender.set_enabled(false); 

2. Enable the treeview in OnClientNodePopulated event handler:

function OnClientNodePopulatedHandler(sender, e) 
   sender.set_enabled(true); 

That should fix the problem.

All the best,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ingo Buck
Top achievements
Rank 1
answered on 16 Mar 2009, 10:16 AM
Hi Veselin Vasilev,

not exactly, but it works now. There was just a single problem left:
If you expand a node a second time, OnClientNodeExpanded is called, but OnClientNodePopulated is not. (PersistLoadOnDemandNode=True).
The OnClientNodeExpandedHandler should be modified to check whether or not a node has child nodes already.

function OnClientNodeExpandedHandler(sender, e) { 
            var node = e.get_node(); 
            if (node != null) if (node.get_nodes().get_count() <= 0) sender.set_enabled(false); 
        } 

Thanks a lot,
Ingo Buck
Tags
TreeView
Asked by
Ingo Buck
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Ingo Buck
Top achievements
Rank 1
Share this question
or