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

Bug with ImageButton AlternateText in v2009.3.1314.35

7 Answers 123 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
dstj
Top achievements
Rank 1
dstj asked on 04 Mar 2010, 12:30 AM
Hi,

Here's a bug in v2009.3.1314.35.

Run the following code and you'll see that the tooltip is showing the wrong content. Instead of showing the specified toolitip content, it's showing the AlternateText of the ImageButton use to trigger the tooltip.

This bug appeared in v2009.3.1314.35...
   <form id="form1" runat="server"
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
 
   <h1>Telerik RadToolTip Test - v2009.3.1208.35 vs v2009.3.1314.35</h1> 
   <asp:ImageButton ID="btn" runat="server" ImageUrl="button.png" AlternateText="Press here" /> 
 
   <div> 
      <telerik:RadToolTip ID="rtt" runat="server" Position="Center" RelativeTo="BrowserWindow" 
         Modal="true" TargetControlID="btn" ShowEvent="OnClick" HideEvent="LeaveTargetAndToolTip" 
         ShowDelay="0" Width="500px" Height="500px"
         <h2>Leave the tooltip to close it....</h2> 
      </telerik:RadToolTip> 
   </div> 
   </form> 

Hmm, I had missed it in your release note, but this behavior is very wrong :
Fixed:The RadToolTipManager/RadToolTip interpret the Alt attribute when the target control is explicitly set, not only when AutoTooltipify is used

The ALT attritute is not meant to be tooltipified. Especially when I don't ask it too... It's meant to display something when the image file is missing and to help screen readers understand the page. It's also required to validate as XHTML.

The TITLE tag should be used to build the tooltip, but you already knew that right ?

Is there a workaround as this is definitely not the behavior I want for RadToolTip...

Thanks,

Dominic.

7 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 08 Mar 2010, 03:15 PM
Hi dstj,

I understand your point but if you test images with Alt attribute set under IE6 and IE7 you will notice that all the Alt attributes are shown as tooltips. There is no way to prevent this from happening since this is browser specific behavior and in this case if we do not remove the Alt attribute you will always get two tooltips - one standard and one which is  RadToolTip and thus after some research and discussions we have decided to remove the Alt when tooltipifying. This was so for AutoToolTipify functionality from the creation of the RadToolTipManager control and recently we implemented the same logic for a separate RadToolTip as well due to customers' requests for consistency.

What I can suggest to do in order to get both the Alt and RadToolTip is the following:

<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>


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
dstj
Top achievements
Rank 1
answered on 08 Mar 2010, 03:46 PM
Hi,

I think you missed the point. The tooltip's content is not showing "Leave the tooltip to close it..." like it did in v2009.3.1208.35. After upgrading to v2009.3.1314.35, it started showing "Press here"...

My point is more about the tooltip's defined content being ignored....

Thanks,

Dominic.
0
Svetlina Anati
Telerik team
answered on 09 Mar 2010, 01:56 PM
Hello dstj,

I already answered your other thread and for others who might encounter the same problem I pasted it below:

Hi Dominic,

I apologize for not being clear enough. 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 as already explained.

This being said what I suggest is to remove the Alt /as it was actually removed with the previous version by the manager/ or use the solution I already provided in your forum thread.



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
dstj
Top achievements
Rank 1
answered on 09 Mar 2010, 04:00 PM
(copy paste from my support ticket for the sake a public information)

Hi,

I thought that inner content was the Text property... sorry if it is not.

Would the javascript approach you provided work for the following (complex) case?
   <form id="form1" runat="server">  
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>  
  
   <h1>Telerik RadToolTip Test - v2009.3.1208.35 vs v2009.3.1314.35</h1>  
   <asp:ImageButton ID="btn" runat="server" ImageUrl="button.png" AlternateText="Press here" />  
  
   <div>  
      <telerik:RadToolTip ID="rtt" runat="server" Position="Center" RelativeTo="BrowserWindow"  
         Modal="true" TargetControlID="btn" ShowEvent="OnClick" HideEvent="LeaveTargetAndToolTip"  
         ShowDelay="0" Width="500px" Height="500px">  
         <asp:TextBox id="tbSomeText" runat="server" /> 
         <asp:Button id="btnInnerBtn" runat="server" Text="Inner button" OnClick="btnInnerBtn_Click" /> 
      </telerik:RadToolTip>  
   </div>  
   </form>  

You mentioned that it was client requests that made you decide to change the behaviour in the last service pack. But now, a very basic scenario producing valid XHTML requires a javascript patch. In my opinion, Telerik has failed to consider all aspects before implementing this request...

Dominic.
0
Svetlina Anati
Telerik team
answered on 10 Mar 2010, 12:07 PM
Hi dstj,

We see your point and we appreciate your feedback. Since the setup is complex and there are many different scenarios and different customers' requirements we are logging this feedback and in case it turns out that more customers prefer to change the default behavior we will do so but for the time being we are still gathering feedback.

As to your setup, I modified slightly the script according to it and you can find a working test page attached - let me know whether it meets your requirements now.

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 10 Mar 2010, 04:14 PM
Hi,

This really is the "everyday" scenario for me. Correct me if I'm using the RadToolTip wrong but these are the basic two scenarios in which I use the RadToolTip:

1-  Get the same type of popup as the "Edit Popup" of a RadGrid. Basically, a modal diaglog box with multiples asp buttons, text boxes, events handlers, etc. "Complex logic" in essence.

RadWindow is too "Window-oriented", not enough "Dialog-oriented". A modal RadToolTip was the best solution I found.

Subquestion: How is the RadGrid popup made (RadWindow or RadToolTip)?

2- A classic informatory popup.

Both of these scenarios really are "business as usual" and the first is just as important as the second.

Thanks,

Dominic.
0
Svetlina Anati
Telerik team
answered on 11 Mar 2010, 01:22 PM
Hello dstj,

Hi Dominic,

Straight to your questions:

1) The RadGrid uses its own popup, it is not neither a RadWindow nor a RadToolTip. You can see a working demo of editing a RadGrid with RadWindow below:

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

A demo which uses a RadToolTip is available here:

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/tooltipgrid/defaultcs.aspx?product=tooltip

I am not sure what you mean by : RadWindow is too "Window-oriented", not enough "Dialog-oriented" - one of the main purposes of the RadWindow is to be used as a dialog as shown here:

http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx

while the RadToolTip is designed basically to replace the standard browser tooltip.

2) You can use RadWindow or RadDock which are popup controls.

I also did not understand whether you experience a problem and what is it and I suggest to examine the sample I sent and let me know how it goes.

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.
Cindy
Top achievements
Rank 1
commented on 22 Mar 2022, 03:16 PM

Why is this so difficult?  I do not want a tooltip I just want to show the alt text for an image button.   That is it.  Why can't I re-enable what Telerik has disabled?

One form, One template One item has One image button and I want to show the alternative text on mouseover.

C Mello

cmello@us.medical.canon

Vessy
Telerik team
commented on 24 Mar 2022, 05:50 PM

Hello Cindy,

The issue discussed in this thread is related to the behavior of RadTooltipManager. If you do not want to have a tooltip but only display an alternative text when the image is missing, you can simply define the image button like follows:

         <asp:ImageButton ID="btn" runat="server" ImageUrl="button.jpg" AlternateText="Press here" />  

 

 

Tags
ToolTip
Asked by
dstj
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
dstj
Top achievements
Rank 1
Share this question
or