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

radtooltip does not work after ajax refresh

1 Answer 99 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Mohammad Armin
Top achievements
Rank 1
Mohammad Armin asked on 14 Jul 2011, 03:31 PM
Hi Everyone

I'm new to this site and this is my first post. So please forgive me if this issue had alrady been posted.

I have a radtooltip inside a simple webpart (not a visual webpart) in a Sharepoint project. Because the webpart is not a visual one, I create a tooltip together with all the other components on the server side in the OnPreRender event.

There is a radajaxpanel surounding the webpart which in turn contains a div which in turn contains a table for every record I want to display in the webpart. Each table contains a radtooltip. There is also a radajaxloadingpanel that points to my webpart.

My webpart is connected to a calendar webpart on the page. When the user interacts with the calendar webpart and selectes a different date, I refresh my webpart  to display the data for that day. The problem is the radtooltip in my webpart stops working after the webpart is refreshed via ajax.

Also, when the page first loads or does a full refresh, sometimes the radtooltip works and sometimes it does not.

The bit of the code that creates the tooltip in the webpart is as follows:

RadToolTip tooltip = new RadToolTip();
tooltip.ID = "RadToolTip" + note.ID;
tooltip.TargetControlID = "divSubject" + note.ID;
tooltip.IsClientID = true;
tooltip.ShowEvent = ToolTipShowEvent.OnMouseOver;
tooltip.HideEvent = ToolTipHideEvent.LeaveToolTip;
tooltip.RelativeTo = ToolTipRelativeDisplay.Element;
tooltip.Skin = "Hay";
tooltip.Animation = ToolTipAnimation.None;
tooltip.ShowCallout = true;
tooltip.Title = note.Subject;
tooltip.CssClass = "diaryToolTip";
tooltip.EnableAjaxSkinRendering = true;
tooltip.RegisterWithScriptManager = true;
    
string line = @"<table border='0'>
<tr>
<td valign='top' align='left' width='60'>
<strong>Type: </strong>
</td>
<td align='left'>" + note.TypeName +
@"</td>
</tr>
</table>";

tooltip.Controls.Add(new LiteralControl(line));
phDiary.Controls.Add(tooltip);

 

 

("note" is a custom class and "phDiary" is the placeholder object that holds all components)

Any help is greatly appreciated.

Regards

Mohammad

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 19 Jul 2011, 10:38 AM
Hi Mohammad,

Such non-consistent behavior would usually mean that the target control is not set properly, most often caused by a typing error in the provided ID. Please make sure that this property is always correct and that you are using the ClientID if the target is a server control, as an INaming container would change this ID and the tooltip wouldn't show. I prepared a simple test page that tries to emulate your behavior, yet it works fine on my end. Please compare your setup with it and try to locate any major differences in the logic.

Another possible cause would be a JavaScript error on the page, which would result in the RadToolTip's scripts not executing. Please also check your project for this as well.


Kind regards,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ToolTip
Asked by
Mohammad Armin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or