OnClientResponseEnd XmlHttpPanel

5 posts, 1 answers
  1. Carl
    Carl avatar
    20 posts
    Member since:
    Nov 2008

    Posted 04 Sep 2009 Link to this post

    Hi there,

    i have got up and running with this panel and now want to add a javascript method for OnClientResponseEnd. I have added the method and I have tested that it is being called, but when the method is included the panel does not update at all. Can anyone help please?

    Here's the property on my panel: OnClientResponseEnd="showTooltipIfRequired"

    Here's the method (wrapped in a RadCodeBlock):

              function showTooltipIfRequired() { 
                        var m_c = document.getElementById("m_c"); 
                        if (m_c.innerHTML != "0") { 
                            var tooltip = $find("NewMessagesToolTip"); 
                            tooltip.show(); 
                        } 
                    } 

    Do I need to add additional arguments to the method signature? I tried adding sender/args but the same happens.

    Thanks, Carl
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 09 Sep 2009 Link to this post

    Hi Carl,

    I built up a test demo based on your explanations but unfortunately to no avail - I was not able to observe the problem (as far as I understood, it is that the content of the panel does not get updated). The demo includes a RadComboBox, when you select an item, a label in the panel is updated with the selected value and a tooltip is shown through your code in the OnClientResponseEnd event. However, the label in the RadXmlHttpPanel is correctly updated as expected.

    I attached my test demo for your reference. If the problem persists, please let me know how to modify the attached code so that I will be able to observe the issue.

    Kind regards,
    Svetlina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Carl
    Carl avatar
    20 posts
    Member since:
    Nov 2008

    Posted 09 Sep 2009 Link to this post

    Hi again,

    Thanks very much for your response. My XmlHttpPanel uses a web service to return the panel contents rather than the code behind - do you think that this could be the reason for the panel contents being cleared? I use this code to poll the web service every few seconds:

            var int = self.setInterval("updatePanel()""<%# RefreshInterval %>"); 
            function updatePanel() { 
                var panel = $find("<% =CommXmlHttpPanel.ClientID %>"); 
                panel.set_value("<%# ID %>"); 
      
            } 

    Without the OnClientResponseEnd code this works perfectly, but as soon as it's added the panel is empty.

    Many thanks once more, if I can get to the bottom of this it'll be fantastic!

    Cheers, Carl


  5. Carl
    Carl avatar
    20 posts
    Member since:
    Nov 2008

    Posted 14 Sep 2009 Link to this post

    Hello again,

    I have updated to the lastest version of the controls to see if this would clear the problem but unfortunately it is still there. I have changed to use 'OnClientResponseEnding'. Here is my panel:

    <telerik:RadXmlHttpPanel ID="CommXmlHttpPanel" runat="server" WebMethodName="GetUnreadCount" OnClientResponseEnding="showTooltipIfRequired" 
        Value="<%# ProviderID %>" WebMethodPath="ScriptServices/CommunicatorService.asmx" /></a

    Take away the OnClientResponseEnding attribute and the panel displays correctly on each update.

    Any ideas would be greatly appreciated.

    Thanks, Carl
  6. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 14 Sep 2009 Link to this post

    Hi Carl,

    I am not completely sure about your exact setup. However, if you are using the OnClientResponseEnd or OnClientResponseEnding events, they are fired too early and thus client scripts do not get evaluated. What I can suggest is to try whether executing your code in the OnClientResponseEnded event works for your scenario.

    If thsi does not help, please let us know and alos provide more details and code.


    Best wishes,
    Svetlina
    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
UI for ASP.NET Ajax is Ready for VS 2017