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

OnAjaxUpdate Problem

9 Answers 143 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Dan Ehrmann
Top achievements
Rank 1
Dan Ehrmann asked on 08 Nov 2008, 02:38 PM
I have a search page where the user enters some criteria and clicks a button to see list of results. Each row in the results has a 'load on demand' tool tip - I use a tool tip manager to handle this. This all works very nicely, except...

The problem is that the AjaxUpdate event handler gets called even when the search button is clicked. This happens only after the user has viewed one of the tool tips. So, the user arrives on the page and clicks the search button. The search results are displayed (AjaxUpdate is not called). Then the user views a tooltip. AjaxUpdate is called to load the content (as it should be). Then the user clicks the search button again. This time AjaxUpdate *is* called, even though there is no tooltip involved.

My workaround is this code in the AjaxUpdate handler:

 

if (Request.Form["__EVENTTARGET"] != e.UpdatePanel.ClientID) {

 

 

return;

 

}

Is this expected behavior, or a bug, or what?

9 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 10 Nov 2008, 04:01 PM

Hi Dan,

I am not quite sure about your exact configuration and since I do not have your code I can only assume what might be happening on your side. Do you by any chance use a build, older than Q3 2008 (version 2008.3 1105) and have a RadToolTipManager with Autotooltipify set to false and you update it with AJAX? If so, note that there is a known problem when updating the RadToolTipManager with AJAX concerning the Autotooltipify property and we are currently working on it. In order to solve the problem I suggest to use a fake control and add it to the TargetControls collection in the markup - in this case, the tooltipmanager will not iterate trough all the controls to autotooltipify them.

In our latest build the Autotooltipify property is set to false by default and  depending on the specific scenario the problem might disappear but I cannot tell you this for sure because I do not have your code.

This bieng said, if this is the problem, either use a fake target control or upgrade to the latest build and test again. If this is not the case, please prepare a sample, fully runnable reproduction project, open a new support ticket and send it to me along with detailed reproduction instructions.


Regards,

Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dan Ehrmann
Top achievements
Rank 1
answered on 10 Nov 2008, 05:54 PM
I am using the latest build. There is no ajax update. AutoToolTipify is explicitly set to false. Target controls are added in code (in a repeater - one target control per row).

I will see if I can create a sample project.
0
Svetlina Anati
Telerik team
answered on 11 Nov 2008, 08:38 AM
Hello Dan,

Thank you for th eprovided information but unfortunately I am not aware of such problem with the mentioned cnfiguration. I think that indeed the best way to proceed is that you open a support ticket and provide a sample demo. The demo does not need to replicate your whole logic and functionality - please use the less code you can to reproduce the issue. Once I receive the demo and I am able to run it locally I will do my best to help you out.


Greetings,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shawn
Top achievements
Rank 1
answered on 12 Nov 2008, 11:05 PM
protected void rttmAdd_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)

{

 

if (this.IsPostBack)

 

{

 

var x = sender as Control;

 

 

if (x.ClientID.ToLower().IndexOf("rttmAdd".ToLower()) > -1)

 

{

 

var NamesEdit = this.Page.LoadControl("~/WebControls/Sub/Names_Edit.ascx") as Names_Edit;

 

e.UpdatePanel.ContentTemplateContainer.Controls.Add(NamesEdit);

 

}

}

}

I had something like this happening (where AjaxUpdate event is raised unexpectedly), this is how I solved this problem.

If sender is not self, then just ignore.

0
David Jones
Top achievements
Rank 1
answered on 13 May 2009, 04:51 PM
I'm using build "2009.1 311" and having a similar problem (once the ToolTip is displayed, EVERY web contol on the page is called).
Is there a newer build that I should download/install?

Thank you.
0
Svetlina Anati
Telerik team
answered on 16 May 2009, 11:58 AM
Hello guys,

There was a fix to the problem but when testing it, it turned out that this fix caused problems in some common scenarios and that is why we rolled it back. The workaround Shawn provided can be used as a temporary solution and you can use it until we find the best solution to incorporated in the the source code.

We are currently working on fixing the problem and once we do, I will follow you up in this thread.

All the best,
Svetlina
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
akeem
Top achievements
Rank 1
answered on 16 May 2009, 04:13 PM
I am not sure but this kind of sounds like the problem i am having as described here:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radtooltipmanager-problems-with-radgrid.aspx

Where the OnAjaxUpdate event is not called onmouseover in my radgrid unless i perform some event that causes a postback which it is then called eveytime i mouseover.

By the way I still need help with my problem if there is a solution.
0
Svetlina Anati
Telerik team
answered on 18 May 2009, 02:53 PM
Hi Akeem,

I do not think that the problem you describe is the same as discussed in this thread,. However, since the problem occurs only when AJAX request is pperformed and everything works if there is a plain postback, what I can assume is that you update teh target controls but you do not update the tooltip manager and it stores the old targets and values. Please make sure that the manager is updated along with the targets as explained below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx

As to tooltipifying each row of the grid correctly, you should add an aditional condition and modify your code in the following manner:

 protected void Grid1_ItemDataBound(object sender, DataGridItemEventArgs e)  
        {  
            DataRowView row = (DataRowView)e.Item.DataItem;  
              
 
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)  
            {  
                string country = row["Country"].ToString();   
                RadToolTipManager1.TargetControls.Add(e.Item.ClientID, country, true);  
            }  
 
        }  
 

Please, use the provided code and example as a start point for your implementation.

Greetings,
Svetlina
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
Svetlina Anati
Telerik team
answered on 28 May 2009, 08:18 AM
Hi guys,

I am glad to inform you that the problem with the extra firing of the OnAjaxUpdate event of the RadToolTipManager is already solved. The fix is available in our latest SP which was released yesterday and which is already uploaded for download in your accounts.


All the best,
Svetlina
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.
Tags
ToolTip
Asked by
Dan Ehrmann
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Dan Ehrmann
Top achievements
Rank 1
Shawn
Top achievements
Rank 1
David Jones
Top achievements
Rank 1
akeem
Top achievements
Rank 1
Share this question
or