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

Bug? AlternateText on Image and Tooltip

11 Answers 117 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 13 Mar 2010, 12:10 AM
RadControls Q1 2010

I have something like this:
<div class="floatLeft"
            <asp:Image ID="hlpSearchDeleted" runat="server" ImageUrl="~/smallHelp.gif" 
                CssClass="helpIcon" AlternateText="Help"/> 
        </div> 
        <telerik:RadToolTip ID="rtpSearchDeleted" runat="server" TargetControlID="hlpSearchDeleted" 
            HideEvent="LeaveTargetAndToolTip" Position="TopRight" > 
            <div style="width: 310px; padding: 5px;"
                <class="info"
This is my tooltip info.</p> 
            </div> 
        </telerik:RadToolTip> 

It seems that Q1 now shows the text from AlternateText not my content. If I remove AlternateText, my tooltip is showed.

Is this a bug or is this desired ? Otherwise, how to control this behavior?

11 Answers, 1 is accepted

Sort by
0
Orin Book
Top achievements
Rank 1
answered on 15 Mar 2010, 08:00 PM
This should be treated as a bug. We have the exact same issue and is impacting almost 200 web pages in our product. We duplicated this posts work around. As Alternate text is a requirement for strict XHTML. Please can support respond to this? Respectfully, Orin Book
0
Orin Book
Top achievements
Rank 1
answered on 16 Mar 2010, 01:38 AM
further investigation. The <DIV> tag data is causing the break. Once removed from inside the RadToolTip, all is well. However, this limits the ability to customize the data withing the tooltip. Is there a new tooltip class to put this data in other that the TEXT attribute? 
0
Accepted
Svetlina Anati
Telerik team
answered on 16 Mar 2010, 04:53 PM
Hello guys,

 You are correct that the behavior regarding the separate tooltip and the Alt attribute has been changed. Note, however, that one of the main purposes [among others] of RadToolTip is to be used as a replacement of the "standard browser tooltip". This is the reason that the tooltip, as its highest priority reads the title or alt attribute of the element (as it is the title/alt attribute that causes a browser tooltip to be displayed).

As a result, in fact there are 4 ways to display content in a tooltip - by reading its TargetControl's title attribute, by setting the RadToolTip's Text property, or by writing HTML between the RadToolTip opening and closing tags.

Here is the correct priority for the three approaches to setting the RadToolTip content:

1. RadToolTip Text property
2. [target control] title attribute / ToolTip server property
3. alt attribute/AlternateText server property
4. RadToolTip content between opening/closing tags

Since the tooltip manager used to work like above explained from its creation when autotooltipify is used, we got customers` requests to make this behavior consistent and the same for the separate RadToolTip as well.

Note, that before this when a separate RadToolTip was used the Alt was removed as well - this is needed because under IE6 and IE7 this causes double tooltips - one standard generated from the Alt and one RadToolTip. This being said the only actual change is that the separate tooltip now gets the Alt text as the standard and also as the tooltip manager works. This change is also documented below:

http://www.telerik.com/products/aspnet-ajax/whats-new/release-history/q3-2009-sp2-version-2009-3-1314-2367038387.aspx

What I can suggest to do in order achieve what you need is either not to set the Alt or  to use some simple js code as the one shown below which I prepared for you:

<form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager
    <script type="text/javascript"
        
    function setToolTip() 
    
       var img = $get("<%=imgRating.ClientID %>"); 
       var alt = img.getAttribute('alt'); 
       var regTooltip = img.getAttribute('regulartooltip'); 
       if(!alt || alt == '') img.setAttribute('alt', regTooltip); 
    }         
        
    </script
    <img src="Sunset.jpg" runat="server" onmouseover="setToolTip();"
        regulartooltip="myStandardTooltip" id="imgRating" alt="Rate this Page" width="55"
        height="16" /> 
    <telerik:RadToolTip runat="server" ID="tipRating" Title="What do you think?" Skin="Office2007"
        Animation="None" xManualClose="true" Sticky="false" ShowEvent="OnMouseOver" HideEvent="LeaveTargetAndToolTip"
        Width="275" Position="BottomLeft" RelativeTo="Element" OffsetX="0" OffsetY="0"
        TargetControlID="imgRating" IsClientID="false"
        Enter an optional comment with your rating: 
        <textarea id="tbRatingComment" rows="3" cols="30"></textarea
        <small>Report technical problems with this site to the <a href="mailto:sasupport@case.edu"
            webmaster</a>.</small
    </telerik:RadToolTip
</form>




Kind regards,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Roland
Top achievements
Rank 1
answered on 16 Mar 2010, 05:09 PM
Thank you for explanation.
0
Svetlina Anati
Telerik team
answered on 18 Mar 2010, 04:39 PM
Hello guys,

I am glad to hear that my explanation was detailed enough and understandable. I also understand your point but as you see the scenario is pretty complex and this is the best solution we have found till now. However we are continuously gathering feedback and if a better solution appears we will consider changing the current implementation.

Best wishes,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Roland
Top achievements
Rank 1
answered on 18 Mar 2010, 04:43 PM
Feedback: Add property to tooltip:

(name to be choosen ofc)
TooltipOrder

where
public enum TooltipOrder
{
AltContent
ContentAlt
}

Where Alt means use the Alt text of the target and Content means use explicit content from the tooltip.
0
Svetlina Anati
Telerik team
answered on 23 Mar 2010, 12:50 PM
Hello Roland,

I logged your suggestion in our database for consideration.  However, before we change the code we gather feedback and we discuss how to proceed and thus I cannot ensure that this will be implemented.

Thank you once again for your suggestion, we will take it into account. If you face problems, do not hesitate to contact us!

Regards,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
dstj
Top achievements
Rank 1
answered on 06 Apr 2010, 06:11 PM
Hi Svetlina,

What is Telerik's standard way of collecting user feedback on features? Might I suggest creating a simple poll to get feedback on this one. Because, as we already discussed here and here, I honestly believe that the behavior change is not an improvement for RadTooltip's users.

That being said, I agree with Roland's suggestion...

Dominic.
0
Accepted
Svetlina Anati
Telerik team
answered on 12 Apr 2010, 08:57 AM
Hello dstj,

I am glad to inform you that we decided to implement a new property which will help in controlling the behavior related to the Alt attribute. The new property will be most probably available for the official Q2 2010 release and its default value will be such that the behavior will stay the same as it is now but by setting it explicitly you will be able to avoid removing the Alt.

Greetings,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
dstj
Top achievements
Rank 1
answered on 13 Apr 2010, 04:11 PM
Hi, this is very good news indeed. Thought, I believe that you should make the default behavior be as it was before the 2009 Q3 SP2 version and simply call that version as a temporary mishap ;-)

Thanks for the follow up,

Dominic.
0
Roland
Top achievements
Rank 1
answered on 13 Apr 2010, 04:14 PM
It is great to hear that !
Tags
ToolTip
Asked by
Roland
Top achievements
Rank 1
Answers by
Orin Book
Top achievements
Rank 1
Svetlina Anati
Telerik team
Roland
Top achievements
Rank 1
dstj
Top achievements
Rank 1
Share this question
or