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

Problems with onajaxload and Radtooltipmanager

10 Answers 533 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Jon Hobbs
Top achievements
Rank 1
Jon Hobbs asked on 27 May 2007, 08:43 PM
Hi Guys,

After sorting out my recent problems getting radtooltip to work inside a datalist I found out i can't use Load on Demand with a tootip, only with a tooltip manager so I have had to rewrite it all to get it working. However I am having lots of problems.

First of all here is my code.

<%@ Page Language="VB" MasterPageFile="Master.master" %> 
<%@ MasterType  virtualPath="Master.master"%> 
 
<%@ Import Namespace="System.Configuration.ConfigurationManager" %> 
<%@ Import Namespace="System.Data" %> 
<%@ Import Namespace="System.Data.SqlClient" %> 
<%@ Import Namespace="System.collections.Generic" %> 
<%@ Import Namespace="Tvi" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
 
 
<script runat="server"
     
    Dim Reader As SqlDataReader 
    Dim Files As String = AppSettings("files_url") 
 
    Sub Page_Load() 
         
        MyRepeater.DataSource = Database.getDataReader("SELECT TOP 10 Caption, Thumbnail FROM Photos") 
        MyRepeater.DataBind() 
         
    End Sub 
     
     
    Sub MyRepeaterBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) 
         
        If e.Item.ItemType = ListItemType.AlternatingItem OrElse e.Item.ItemType = ListItemType.Item Then 
             
            Dim TempImage As Image = DirectCast(e.Item.FindControl("MyImage"), Image) 
             
            Dim ClientID As String = TempImage.ClientID 
             
            CommentToolTip.TargetControls.Add(ClientID, True) 
             
        End If 
         
    End Sub 
     
     
    Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs) 
        Dim elementID As String = args.TargetControlID 
        'Add content when necessary 
        args.UpdatePanel.ContentTemplateContainer.Controls.Add(New HtmlGenericControl("HR")) 
    End Sub 
         
</script> 
 
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
     
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"
        <ContentTemplate> 
         
         
            <asp:repeater runat="server" id="MyRepeater" onitemdatabound="MyRepeaterBound"
                    <itemtemplate> 
                        <asp:image runat="server" id="MyImage" imageurl='<%# Files + DataBinder.Eval(Container.DataItem, "Thumbnail")%>'/> 
                    </itemtemplate> 
                </asp:repeater> 
         
         
        </ContentTemplate> 
    </asp:UpdatePanel> 
     
    <telerik:radtooltipmanager  
        runat="server"  
        id="CommentToolTip"  
        ManualClose="true" 
        Sticky="true"  
        Title="Hello"  
        Skin="Web20"  
        Width="350px"  
        Height="250px"  
        Position="MiddleRight"  
        OffsetX="6" 
        Animation="Fade"  
        OnAjaxUpdate="OnAjaxUpdate"
    </telerik:radtooltipmanager> 
         
         
         
</asp:Content> 

I should explain that line 21 uses a function of our own data layer. My problems are as follows....

1) When i remove the OnAjaxUpdate="OnAjaxUpdate" the page works. It shows a blank tooltip when you click on each photo. However, when I add the OnAjaxUpdate back in it stops working. The tooltips show for half a second then disappear again.

It does this in Firefox and IE and does it when i take all of the code out of the onajaxupdate sub too so the problem doesn't seem to be with the contents of that sub.

2) Because I am now using a radtooltipmanager rather than a radtooltip inside the datalist i have no idea how to change the title of the tooltip to the "Caption" I am getting from the database. When I was using a tooltip in the datalist I just did this...

Title='<%# DataBinder.Eval(Container.DataItem, "Caption") %>'

3) I copied the OnAjaxUpdate Sub from a telerik example but have no idea what it is doing. WHy is ElementID declared and then not used ? And what is args.UpdatePanel.ContentTemplateContainer.Controls.Add ? Does the Tooltip have it's own updatepanel inside it ?


Any help would be really appreciated as I just don't understand the online demos or the documentation. A very simple example would be useful to many others I'd guess.

Thanks, Jon


10 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 30 May 2007, 01:31 PM
Hi Jon,
Straight to your questions:
  1. We are aware of this issue and our developers are currently working on it to provide a solution as soon as possible. The problem manifests when you try to use the Ajax (UpdatePanel in your case) and ToolTipManager with OnAjaxUpdate.
  2. In case you just add the elements to the TargetControls collection of the RadToolTipManager and specify their Title attribute (or ToolTip attribute) the way you have for the RadToolTip (without having OnAjaxUpdate), the content of the RadToolTip will equal the value of the Title (ToolTip) attribute. Once you decide you want to use the OnAjaxUpdate, you decide to manage the content of the RadToolTip on the server. Right before a RadToolTip open, the AjaxUpdate event fires and on the server , you get an UpdatePanel to which you can add controls that will appear in the RadToolTip.
  3. You only need the OnAjaxUpdate handler in case you want to add content to the RadToolTip after you execute some server code. In case you refer to the Load on demand example, the elementID used in the UpdateToolTip method.

In order to get familiar with the RadToolTip control, I would recommend that you have a look at our online Help.

All the best,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jon Hobbs
Top achievements
Rank 1
answered on 30 May 2007, 01:48 PM
Hi Tsvetie,

Thanks for your answers. I am stull a little confused though (actually very confused).

So, from answer 1 am I right in thinking that nobody is currently able to to use  onajaxupdate with a tooltipmanager ? If that is the case then how come your online demo  here works fine ?

Do you have any idea when a fix might come ? I am trying to use it on a project with only 2 weeks to go so I need to know whether to use something different.

Also, If I am reding your answer to question 2 correctly, are you saying that there is no way to programatically change the title of the tooltip when it is bound, I have to add my own title control as part of the onajaxupdate ? If so that makes sense.

Thanks again, Jon

 
0
Tsvetie
Telerik team
answered on 31 May 2007, 11:05 AM
Hi Jon,
  1. The online demo that you refer to does not use un UpdatePane to wrap the Repeater - that is why there is no problem with the example.
  2. I already sent you the hotfix.
  3. Yes, that is absolutely correct. With the OnAjaxUpdate handler, you update only the content of the RadToolTip. That is why you cannot change the Title.
Regards,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jon Hobbs
Top achievements
Rank 1
answered on 31 May 2007, 02:49 PM
Hi Tsvetie,

Thank you for the Hotfix, it seemed to fix the problem in firefox but now I am getting a new problem.

If i open the tooltips on my page lots of times, sometimes the page refresthes so there seems to be a postback happening. But it seems to be random and you have to click the tooltips open about 20-30 times before it seems to happen.

Has anyone else had this problem ?

Jon
0
Raj Kanaparti
Top achievements
Rank 1
answered on 03 Jun 2007, 03:37 PM
Hello :

I have a RadAjaxPanel in which I have a GridView .In each gridView I have a ToolTip control that displays a user control. I am binding the Tooltip control to asp:button in DataRowbound event.
When the Page first renders , I can click on the Button and the tooltip shows up with the user control. But when I have a post back say suppose clickling a check box in grid view , the tooltipControl doesnt work any more.

Can you please let me know if some one has a solution to this problem.

Thanks,
Rajesh
0
Tsvetie
Telerik team
answered on 04 Jun 2007, 12:17 PM
Hello Raj and Jon,
Please open new support tickets and we will send you a hotfix that fixes the described problems.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Hanumesh
Top achievements
Rank 1
answered on 14 Jun 2007, 06:56 AM
HI,

I am using RADtooltipManager in RADGrid, I am adding RadGrid column values(client IDs) as targetControld for Tooltip Manager in Grid's ItemDataBound Event and in AjaxUpdate event am loading a usercontrol into the update panel. so, when I mouse over to any item in the grid am getting a tooltip for that element. But I too have a button in my grid and on click its submitting the page. After postback of the page tooltip is not working.
I found that on submit of the page its not calling ItemDataBound event of the grid where I am adding targetcontrols to Tooltip manager. Is this the cause for tooltip not working on postback?

I appreciate if anybody suggest some solution.

Thanks,
Hans.
0
Tsvetie
Telerik team
answered on 14 Jun 2007, 12:45 PM
Hello Hanumesh,
Indeed this is causing the problem. We have updated the RadToolTipManager so that it persists its TargetControls collection across postbacks. Please have a look at the other forum thread, where you asked the same question for the hotfix.

Sincerely yours,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simerpreet
Top achievements
Rank 1
answered on 19 Jul 2010, 08:17 AM
Hi ...I am facing the same issue as specified in point 1.....Can anyone please send me the hot fix provided for the same....Any help will be appreciated...
0
Svetlina Anati
Telerik team
answered on 20 Jul 2010, 09:10 AM
Hello Hanumesh,

This thread has been opened 3 years ago and a lot of things has changed in RadToolTip and RadControls. What I suggest is to upgrade to a later or best the latest version of RadControls and everything should work fine. Hotfixes are provided only as a temporary solution while the fix is available in an official release and this is the case with the mentioned problem.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Jon Hobbs
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Jon Hobbs
Top achievements
Rank 1
Raj Kanaparti
Top achievements
Rank 1
Hanumesh
Top achievements
Rank 1
Simerpreet
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or