Bug with ImageButton AlternateText in v2009.3.1314.35

8 posts, 0 answers
  1. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 03 Mar 2010 Link to this post

    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.
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 08 Mar 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 08 Mar 2010 Link to this post

    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.
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 09 Mar 2010 Link to this post

    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.
  6. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 09 Mar 2010 Link to this post

    (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.
  7. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 10 Mar 2010 Link to this post

    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.
  8. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 10 Mar 2010 Link to this post

    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.
  9. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 11 Mar 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017