RadTreeNode with ServerSideCallBack is never expanded after sending ajax request

16 posts, 0 answers
  1. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 23 Jul 2008 Link to this post

    I'm sorry. Something is wrong with my internet connection I've posted thread few times.
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 23 Jul 2008 Link to this post

    Hi Pavel,

    Please report your question since it seems to be lost due to the duplication of the initial post.

    Kind regards,
    Stephen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 23 Jul 2008 Link to this post

    I'm sorry for my connection once more. Here is my question:

    I've encountered problem with simultaneous sending ajax request and expanding nodes with ServerSideCallBack expand mode. Node is never expanded in this case.
    Pls see the following code.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestTreeViewExpanding._Default" %>  
      
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>  
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
      
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Test Page</title>  
    </head>  
    <body>  
        <form id="form1" runat="server">  
            <asp:Panel ID="Panel1" runat="server">  
                <asp:ScriptManager ID="SM" runat="server" />  
                <script type="text/javascript">  
                    function OnLoadTree()  
                    {  
                        var ram = $find('<%= ram.ClientID %>');  
                        ram.ajaxRequest('');  
                      
                        var tree = $find('<%= TreeView.ClientID %>');  
                        tree.get_nodes().getNode(0).expand();  
                    }  
                    Sys.Application.add_load(OnLoadTree);  
                </script>  
            </asp:Panel>  
      
            <telerik:RadTreeView ID="TreeView" Runat="server"  
                LoadingMessage="Accessing... ">  
                <Nodes>  
                    <telerik:RadTreeNode Text="Root" ExpandMode="ServerSideCallBack" />  
                </Nodes>  
            </telerik:RadTreeView>  
      
            <telerik:RadAjaxManager ID="ram" runat="server" RequestQueueSize="5" />  
        </form>  
    </body>  
    </html>  

    If you run my example you'll see loading message "Accessing..." appears after page loading. It never disappears and root node is never expanded although it should. If you remove sending of ajax request all works fine. Loading message disappears and root node expanded (it's empty by design).

    Is there any way to load node on demand when ajax request is in process?
  4. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 11 Aug 2008 Link to this post

    Can anyone comment this?
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 12 Aug 2008 Link to this post

    Hello Pavel,

    I tested the code supplied, and the controls behaved as expected. Attached to this message, you will find the code, which I used for testing. Take a look at it and let me know if this is the expected behavior or I am leaving something out.

    All the best,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 12 Aug 2008 Link to this post

    Attached example is correct. I checked it with the lastest version of Telerik (2.723). It works with Telerik for Net2.0. But it doesn't work correctly with Telerik for Net3.5 (the problem I described exists).
  7. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 14 Aug 2008 Link to this post

    Yavor, can you reproduce described behavior with Telerik for Net 3.5?
  8. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 14 Aug 2008 Link to this post

    Hello Pavel,

    Yes, I was indeed able to replicate the erroneous behavior with the 3.5 version of the controls.
    I will investigate the issue further, and update this thread as necessary.

    Greetings,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 14 Aug 2008 Link to this post

    Thanks, Yavor. I'll be waiting for your reply.
  10. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 18 Aug 2008 Link to this post

    Hi Pavel,

    As I see from the code, on pageLoad() you are making an ajaxRequest and this is an endless cycle.

    Can you explain in more detail what are you trying to achieve?

    Kind regards,
    Veskoni
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 18 Aug 2008 Link to this post

    Hi, Veskoni.

    It's just an example. I tried to make as simple as I could. My page sends ajax requests during which user are able to expand tree nodes. And I see described behavior if node data is loaded on demand when another ajax request is in progress already.

    I placed OnLoadTree() method in load event just to simplify example. I tried to add button and call OnLoadTree() method on clicking it and experienced the same behavior.

    Is this something wrong with the calling OnLoadTree() method on page load? I'm quite new to web development and ajax so I can make stupid mistakes.
  12. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 21 Aug 2008 Link to this post

    Hi Pavel,

    Maybe it is better to disable the treeview while there is an Ajax request to the server.

    You can check this help article:
    Disable controls during AJAX

    I hope this will get you started.

    Greetings,
    Veskoni
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. Pavel
    Pavel avatar
    9 posts
    Member since:
    May 2008

    Posted 22 Aug 2008 Link to this post

    Hi, Veskoni.

    Thanks for advice. But I can't disable tree view cause it's main control on page. Actually I checked my example with respect to your previous post once more. I removed expand in OnLoad() handler (I replaced it with button click) and found that it's possible to expand node later (on third or second try to expand node) when request is finished. It's not very good but it's suitable solution.

    Thank you for your help.
  14. Daniel Sim
    Daniel Sim avatar
    9 posts
    Member since:
    Nov 2009

    Posted 02 Dec 2009 Link to this post

    I am experiencing this issue too.

    1) Ajax request (a) started by user
    2) Before request returns, user tries to expand node (b)
    3) (a) returns from server
    4) (b) never completes

    Even enabling RadAjaxManager queue doesn't resolve this.

    Does the RadTree use the RadAjaxManager? Other requests work okay, cancelling the (a) request as desired.

    Dan
  15. Daniel Sim
    Daniel Sim avatar
    9 posts
    Member since:
    Nov 2009

    Posted 03 Dec 2009 Link to this post

    I can confim that expanding a treenode using ServerSideCallBack is not cancelling the RadAjaxManagerRequest.

    Is this by design? Seems strange to me.

    Dan
  16. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 07 Dec 2009 Link to this post

    Hi Daniel,

    Can you please post the code, which you are presently using, so that I can replicate the issue with it locally, and make sure that we are on the same page.
    Thank you.

    Greetings,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top