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

update target control when tooltip show

4 Answers 68 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Mattia
Top achievements
Rank 1
Mattia asked on 14 Jul 2011, 09:03 AM
Hello all,
I have a user control that is made this way.
There is a RadListView.
Each item in the list view contains a checkbox.
Each checkbox is added in the list ot the TargetControls of a TooltipManager.

When the user click on the checkbox the tooltip correctly show but the checkbox is not checked. I think is due to ajax not updating the checkbox.

There's a way to solve this?

Thanks,
Mattia

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 14 Jul 2011, 04:19 PM
Hello Mattia,

  The checkbox has a default behavior for the click event. When a tooltip targets it with its ShowEvent set to OnClick this overrides the default behavior. You can confirm this without a tooltip as well by simply attaching some JavaScript function to the onclick event. What I would suggest is that you change the ShowEvent to OnMouseOver.


Greetings,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mattia
Top achievements
Rank 1
answered on 14 Jul 2011, 04:43 PM
Hello Marin,
when I try the mouseover the tooltip appear and disappear continuosly.
Is it possibile to use the ShowEvent="FromCode" and open it from javascript? Can you provide an example. I found an example with HideEvent="FromCode" but i cannot find one with ShowEvent="FromCode".

Also, is it normal that for every postback raised by the controls in the tooltip i always have an OnAjaxUpdate.

Thanks,
Mattia
0
Accepted
Marin Bratanov
Telerik team
answered on 19 Jul 2011, 11:15 AM
Hello Mattia,

This behavior may be observed because of the way the mouseover and mouseout events work - they are thrown quite often and especially for small elements such as the checkboxes.  For some more information on the matter please examine the following article: http://www.quirksmode.org/js/events_mouse.html. You can try setting the HideDelay property to some larger value to try to work around the mouseout event hiding the tooltip too often.

When using the ToolTipManager with the OnAjaxUpdate event the user control is actually loaded inside an update panel, which means that a postback from within will result in an AJAX request, which goes through the whole page lifecycle on the server (and the user control is still a part of the page), so, yes, it is normal.

As for an example with the ShowEvent = FromCode - it would result in the same behavior as the OnMouseOver (as it actually uses is internally), yet here it is:
    <telerik:RadToolTip ID="RadTooltip1" runat="server" ShowEvent="FromCode" ShowDelay="0" HideDelay="100"
        IsClientID="true" Position="BottomLeft" RelativeTo="Element" Height="50px" Width="120px"
         HideEvent="FromCode">
        Content for the tooltip
    </telerik:RadToolTip>
  
<asp:CheckBox runat="server" ID="checkbox1" onmouseover="showToolTip(this)" onmouseout="hideToolTip()" Text="this is a checkbox" />

and the JavaScript:
function showToolTip(trigger)
{
    var tooltip = $find("RadTooltip1");
    if (tooltip != null)
    {
        tooltip.set_targetControl(trigger);
        tooltip.show();
    }
}
 
function hideToolTip()
{
    var activeTooltip = Telerik.Web.UI.RadToolTip.getCurrent();
    if (activeTooltip)
    {
        activeTooltip.hide();
    }
}


Best wishes,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mattia
Top achievements
Rank 1
answered on 20 Jul 2011, 11:48 AM
Thanks for the help now is working.
Tags
ToolTip
Asked by
Mattia
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Mattia
Top achievements
Rank 1
Share this question
or