Not positioning and sizing properly

9 posts, 0 answers
  1. Geoff Van Brunt
    Geoff Van Brunt avatar
    41 posts
    Member since:
    Jan 2006

    Posted 20 Jul 2007 Link to this post

    When I a tooltip is first shown on my page, it is appearing in the wrong spot.(to the left of where it should) However after moving off of the element and back on, it then works correctly. I'm positioning to middleleft of elements. It appears to happen if the text needs to be written on "more than one line" as it would run off the page to the right. Anyone else seeing this behavior?

    I'm using a pre-service pack build (706) right now so perhaps this is a new error?
  2. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 24 Jul 2007 Link to this post

    Hello Geoff,

    We were not able to reproduce the issue.
    Can you send us a simple project that demonstrates the issue, or, in case you are able to reproduce the same behavior on any of our online demos - let us know about the sequence of steps.

    Looking forward to hearing from you,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Tom Underhill
    Tom Underhill avatar
    7 posts
    Member since:
    Jun 2003

    Posted 24 Jul 2007 Link to this post

    I have the same issue. I am using a very simple implementation of ToolTip to show when a user hovers over a question mark image. First hover the ToolTip shows in the bottom left of the screen. Second hover it shows nearer the image but the ToolTip arrow is wrong. Third attempt all is well. Very frustrating!

    Incidently the Tooltip does reside within a TabStrip PageView and is also in a Masterpage enabled site.

    Regards,
  4. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 25 Jul 2007 Link to this post

    Hi Tom Underhill,
    I was able to reproduce the problem, that Geoff Van Brunt described and forwarded it to our developers. One possible workaround for this case is to set the Width of the RadToolTip. In case this does not solve your problem, could you please prepare and send us a simple running project, that demonstrates it?

    Best wishes,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 19 Sep 2007 Link to this post

    I am posting the answer to a separate support ticket regarding this issue in this forum thread as well
    ---------------------------------------------------------------------------------------------------------------------------------------------------------

    Hello Geoff,

    It is a very tricky issue to deal with (not from coding point of view, but from a logical point of view). Here is what happens:

    1. The tooltip does not have a fixed width by default. So, providing long text without setting a specific width is bound to create a long tooltip - in your case longer than the screen.
    2. However - tooltips must stay in the screen. Thus, when the tooltip is shown, its wdith is automatically corrected to fit the screen, and its display position is adjusted to make sure it does not go out of the screen either.

    Thus, the behaior you notice occurs.

    The issue by itself is bigger than the simply making sure the tooltip uses the space to the right - from the target control to the right of the page. The tooltip can be positioned above, below, diagonally etc relative to the target control - and keeping it both in sight, and properly positioned requires a more general solution.

    For the time being, we suggest the following hack which is general enough and does not require you to set explicit heights:

     <script> 
            var toggleShow = false;  
            function OnClientShow(sender)  
            {  
                toggleShow = !toggleShow;  
               if (toggleShow)  
               {  
                sender.hide();  
                sender.show();  
               }  
            }          
              
            </script> 
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
            &nbsp;  
            <telerik:RadToolTip ID="RadToolTip1" runat="server" IsClientID="True" Position="MiddleRight" 
               
                    RelativeTo="Element"   
                    OnClientShow="OnClientShow" 
                      
                    Skin="Web20Orange" TargetControlID="TextBox1"   
                    Text="This is some text that is really long and should run off the page and onto another line. If it does not, shrink the window and then refresh the page. At first it will show over the text box, then it will show in the correct location after the seconc mouseover.">  
            </telerik:RadToolTip> 

    Essentially, the code causes a tooltip that is shown to be hidden and re-shown again - thus causing it to resize properly.

    Greetings,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. MB
    MB avatar
    149 posts
    Member since:
    Jan 2005

    Posted 18 Oct 2007 Link to this post

    I tried that, but ran into a problem as I had OnAjaxUpdate defined... and doing a hide() and show() causes the Ajax request to fire again.

    If you want have some fun... place an AjaxManager.ResponseScripts.Add("myScriptfunction()")  in the OnAjaxUpdate event handler, and then do a hide() and show() in that client function.

    ...infinte loop created.
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 23 Oct 2007 Link to this post

    Hi MB,

    In this case we would recommend to use the following approach:

    <script>    
    var toggleShow = false;     
    function OnClientShow(sender)     
    {     
        toggleShow = !toggleShow;     
       if (toggleShow)     
       {     
        sender.hide();     
        //instead of show(), call _show because it doesn't throw the show event and   
        //it does not call AjaxUpdate  
        sender._show();     
       }     
    }             
         
    </script> 
    &nbsp;  
    <br /> 
    <br /> 
    <br /> 
    <br /> 
    <br /> 
    <br /> 
    <br /> 
    <br /> 
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
    <telerik:RadToolTipManager   
        ID="RadToolTipManager1"   
        runat="server"   
        OnClientShow="OnClientShow" 
        Position="MiddleRight"   
        RelativeTo="Element"   
        Skin="Web20Orange"   
        OnAjaxUpdate="RadToolTipManager1_AjaxUpdate">  
        <TargetControls> 
            <telerik:ToolTipTargetControl TargetControlID="TextBox1" /> 
        </TargetControls> 
    </telerik:RadToolTipManager> 


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Bill
    Bill avatar
    5 posts
    Member since:
    Feb 2008

    Posted 29 Feb 2008 Link to this post

    Just came upon this thread when I encountered this problem using the Q3 2007 release and was wondering...  Will this problem be fixed in the next release or final version of Prometheus?  The hack is kind of ugly.
  9. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 04 Mar 2008 Link to this post

    Hi Bill,

    Yes, this issue has been logged for fixing, and we will do our best to build a workaround into the RadToolTip code itself, as this problem is generating unneeded support. Yet, as pointed out in the thread, when no width is specified and the tooltip text is long - several factors come into play, and the result is not strictly a bug that can be fixed by changing a line or two of code.

    Sincerely yours,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top