PDA

View Full Version : [FIXED] [V0.8.0] RadioGroup



DGil
Jan 26, 2009, 9:19 AM
I can't access to the property checked of an item of radioGroup in the server code.
The property value is always False.


Some suggestion?





Regards.

Vladimir
Jan 26, 2009, 9:56 AM
Hi,

Can you show how you are working with RadioGroup?
 

DGil
Jan 26, 2009, 9:59 AM
ASP:



<ext:RadioGroup ID="RadioGroup4" runat="server" HideLabel="true" ColumnsNumber="1" Vertical="true"


ItemCls="x-check-group-alt">


<Items>


<ext:Radio ID="radioButton1" runat="server" BoxLabel="<%$ Resources: radioButton1.BoxLabel %>"/>


<ext:Radio ID="radioButton2" runat="server" BoxLabel="<%$ Resources: radioButton2.FieldLabel %>"/>


<ext:Radio ID="radioButton3" runat="server" BoxLabel="<%$ Resources: radioButton3.FieldLabel %>"/>


</Items>


</ext:RadioGroup>C#



if (radioButoon1.Checked){

}

Is it helpfull for you??

Vladimir
Jan 26, 2009, 10:15 AM
Can you show full sample which demonstrate the problem? When you call code which checks the Checked property?
Here is my test sample which works fine:


<%@ Page Language="C#" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!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 id="Head1" runat="server">
<title></title>
<script runat="server">
protected void IsRadio1Selected(object sender, AjaxEventArgs e)
{
ScriptManager1.AddScript("alert('Selected = {0}');", radioButton1.Checked);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:RadioGroup ID="RadioGroup4" runat="server" HideLabel="true" ColumnsNumber="1"
Vertical="true">

<Items>
<ext:Radio ID="radioButton1" runat="server" BoxLabel="Label1" />
<ext:Radio ID="radioButton2" runat="server" BoxLabel="Label2" />
<ext:Radio ID="radioButton3" runat="server" BoxLabel="Label2" />
</Items>
</ext:RadioGroup>

<ext:Button runat="server" Text="Is radio1 selected?">
<AjaxEvents>
<Click OnEvent="IsRadio1Selected">
</Click>
</AjaxEvents>
</ext:Button>
</form>
</body>
</html>

DGil
Jan 26, 2009, 11:48 AM
It seems I have found the issue.

My page is not working because I set EnableViewState to false in my Page (aspx).

On false, the radioButton is loosing his value, on true everything is OK.

Vladimir
Jan 26, 2009, 12:21 PM
Hi,

Thanks for update. We confirm that this is a bug. We will fix it (the fix will be allowed in 0.8.0 release).
Now, as work-around, you can set GroupName manually for each item of RadioGroup and set AutomaticGrouping="false" for RadioGroup.


 

DGil
Jan 27, 2009, 7:47 AM
Thank you very much.