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
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
0
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
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
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
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:
and the JavaScript:
Best wishes,
Marin
the Telerik team
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.