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

OnClientResponseEnd XmlHttpPanel

4 Answers 91 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 04 Sep 2009, 09:45 AM
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

4 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 09 Sep 2009, 09:27 AM
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.
0
Carl
Top achievements
Rank 1
answered on 09 Sep 2009, 10:35 AM
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


0
Carl
Top achievements
Rank 1
answered on 14 Sep 2009, 11:33 AM
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
0
Accepted
Svetlina Anati
Telerik team
answered on 14 Sep 2009, 02:25 PM
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.
Tags
XmlHttpPanel
Asked by
Carl
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Carl
Top achievements
Rank 1
Share this question
or