In Q3 2013 SP1, the OnClientClicking handler of the RadButton will not get called after using the keyboard (enter key or spacebar) to activate the RadButton.
The issue seems to have something to do with the set_cancel() call; if the button is changed to "AutoPostBack=false" and the set_cancel() call is removed, the behavior returns to (mostly) normal. In that case, things work as expected when the enter key activates the button, but the spacebar still causes erratic behavior.
Is there a different way to preserve OnClientClicking behavior with keyboard activation of RadButtons or is this a bug?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function clickHandler(sender, args)
{
args.set_cancel(true);
}
</
script
>
</
telerik:RadScriptBlock
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
div
>
<
telerik:RadButton
ID
=
"btnTest"
runat
=
"server"
Text
=
"Test Me"
OnClientClicking
=
"clickHandler"
></
telerik:RadButton
>
</
div
>
</
form
>
</
body
>
</
html
>
The issue seems to have something to do with the set_cancel() call; if the button is changed to "AutoPostBack=false" and the set_cancel() call is removed, the behavior returns to (mostly) normal. In that case, things work as expected when the enter key activates the button, but the spacebar still causes erratic behavior.
Is there a different way to preserve OnClientClicking behavior with keyboard activation of RadButtons or is this a bug?