Fabricio,
Thanks for your response.
Following what you said, we did more testing with Ver4.3 and found out that the RADIO ctrl is now reporting the CHECKED & VALUE properties correctly on Server-Side POST. So we just need to update to 4.3 to get our project to work.
Now, during our testing, we did find some issues in 4.3 that you guys might be interested in looking at:
This code below is edited page from your samples (
https://examples4.ext.net/#/Form/Mis...Checkout_Form/)
Button at Top "Test Radio (OnDirectClick)" is the main Test
The other buttons at bottom are old demo buttons that were there and other tests we were doing
This code shows a couple of occurrences in which Radio ctrls do not report correct checked/value on PostBack (similar to V4.2):
1. When Radio items inside a Radiogroup (with No ID) and each Radio Item having "NAME" grouping attribute set
2. When Setting the "NAME" attribute using <DEFAULTS> for Radio ctrls in <ITEMS> collection
(This seems to be a <DEFAULTS> bug not a radio button bug)
Also it shows that you can have a RadioGroup(ID set) with Radio items with no NAME grouping set and PostBack (radio checked property works) - I assume this is by design since the radio items are inside an IDed group.
<%@ Page Language="C#" %>
<script runat="server">
public void TestRadio_OnDirectClick(object sender, Ext.Net.DirectEventArgs e)
{
this.TestMessage.SetValue("");
this.TestMessage.SetValue(DebugPrintRadioValues("TestRadio_OnDirectClick"));
this.TestMessage.AppendLine(DebugFormNVColl("TestRadio_OnDirectClick"));
}
public void TestRadio_OnClick(object sender, System.EventArgs e)
{
//THIS EVENT DOES NOT SEEM TO FIRE
this.TestMessage.SetValue("");
this.TestMessage.SetValue(DebugPrintRadioValues("TestRadio_OnClick"));
}
protected void CompletePurchase_ServerSideEvent(object sender, DirectEventArgs e)
{
this.TestMessage.SetValue("");
this.TestMessage.AppendLine(DebugFormNVColl("CompletePurchase_ServerSideEvent"));
}
public string DebugPrintRadioValues(string sFunc)
{
StringBuilder sMsg = new StringBuilder();
sMsg.AppendLine(DateTime.Now.ToString() + new String('=', 60));
sMsg.AppendLine(sFunc);
sMsg.AppendLine(String.Format("RadioW1: Chk=[{0}] Val=[{1}] [{2}]", this.RadioW1.Checked, this.RadioW1.Value, this.RadioW1.InputValue));
sMsg.AppendLine(String.Format("RadioW2: Chk=[{0}] Val=[{1}] [{2}]", this.RadioW2.Checked, this.RadioW2.Value, this.RadioW2.InputValue));
sMsg.AppendLine(String.Format("RadioW3: Chk=[{0}] Val=[{1}] [{2}]", this.RadioW3.Checked, this.RadioW3.Value, this.RadioW3.InputValue));
sMsg.AppendLine(String.Format("RadioW4: Chk=[{0}] Val=[{1}] [{2}]", this.RadioW4.Checked, this.RadioW4.Value, this.RadioW4.InputValue));
sMsg.AppendLine(new String('-', 40));
sMsg.AppendLine(String.Format("RadioX1: Chk=[{0}] Val=[{1}] [{2}]", this.RadioX1.Checked, this.RadioX1.Value, this.RadioX1.InputValue));
sMsg.AppendLine(String.Format("RadioX2: Chk=[{0}] Val=[{1}] [{2}]", this.RadioX2.Checked, this.RadioX2.Value, this.RadioX2.InputValue));
sMsg.AppendLine(String.Format("RadioX3: Chk=[{0}] Val=[{1}] [{2}]", this.RadioX3.Checked, this.RadioX3.Value, this.RadioX3.InputValue));
sMsg.AppendLine(String.Format("RadioX4: Chk=[{0}] Val=[{1}] [{2}]", this.RadioX4.Checked, this.RadioX4.Value, this.RadioX4.InputValue));
sMsg.AppendLine(new String('-', 40));
sMsg.AppendLine(String.Format("RadioY1: Chk=[{0}] Val=[{1}] [{2}]", this.RadioY1.Checked, this.RadioY1.Value, this.RadioY1.InputValue));
sMsg.AppendLine(String.Format("RadioY2: Chk=[{0}] Val=[{1}] [{2}]", this.RadioY2.Checked, this.RadioY2.Value, this.RadioY2.InputValue));
sMsg.AppendLine(String.Format("RadioY3: Chk=[{0}] Val=[{1}] [{2}]", this.RadioY3.Checked, this.RadioY3.Value, this.RadioY3.InputValue));
sMsg.AppendLine(String.Format("RadioY4: Chk=[{0}] Val=[{1}] [{2}]", this.RadioY4.Checked, this.RadioY4.Value, this.RadioY4.InputValue));
sMsg.AppendLine(new String('=', 60));
sMsg.AppendLine(String.Format("RadioZ1: Chk=[{0}] Val=[{1}] [{2}]", this.RadioZ1.Checked, this.RadioZ1.Value, this.RadioZ1.InputValue));
sMsg.AppendLine(String.Format("RadioZ2: Chk=[{0}] Val=[{1}] [{2}]", this.RadioZ2.Checked, this.RadioZ2.Value, this.RadioZ2.InputValue));
sMsg.AppendLine(String.Format("RadioZ3: Chk=[{0}] Val=[{1}] [{2}]", this.RadioZ3.Checked, this.RadioZ3.Value, this.RadioZ3.InputValue));
sMsg.AppendLine(String.Format("RadioZ4: Chk=[{0}] Val=[{1}] [{2}]", this.RadioZ4.Checked, this.RadioZ4.Value, this.RadioZ4.InputValue));
sMsg.AppendLine(new String('=', 60));
sMsg.AppendLine(String.Format("RadioA1: Chk=[{0}] Val=[{1}] [{2}]", this.RadioA1.Checked, this.RadioA1.Value, this.RadioA1.InputValue));
sMsg.AppendLine(String.Format("RadioA2: Chk=[{0}] Val=[{1}] [{2}]", this.RadioA2.Checked, this.RadioA2.Value, this.RadioA2.InputValue));
sMsg.AppendLine(String.Format("RadioA3: Chk=[{0}] Val=[{1}] [{2}]", this.RadioA3.Checked, this.RadioA3.Value, this.RadioA3.InputValue));
sMsg.AppendLine(String.Format("RadioA4: Chk=[{0}] Val=[{1}] [{2}]", this.RadioA4.Checked, this.RadioA4.Value, this.RadioA4.InputValue));
sMsg.AppendLine(new String('=', 60));
return sMsg.ToString();
}
public string DebugFormNVColl(string sFunc)
{
NameValueCollection nvColl = this.Request.Form;
StringBuilder sMsg = new StringBuilder();
sMsg.AppendLine(DateTime.Now.ToString() + new String('=', 60));
sMsg.AppendLine(sFunc);
sMsg.AppendLine("Request.Form");
sMsg.AppendLine(" [NDX] KEY VALUE");
for (int i = 0; i < nvColl.Count; i++)
{
sMsg.AppendLine(String.Format(" [{0}] {1,-10} {2}", i, nvColl.GetKey(i), nvColl.Get(i)));
}
sMsg.AppendLine(new String('=', 60));
return sMsg.ToString();
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Checkout Form - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<h1>Checkout Form</h1>
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:Container runat="server" Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch"></ext:HBoxLayoutConfig>
</LayoutConfig>
<Items>
<ext:FormPanel
runat="server"
Title="Complete Check Out"
Frame="true"
BodyPadding="5" Flex="1">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Test Radio (OnDirectClick)" OnDirectClick="TestRadio_OnDirectClick" Flat="false" >
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<FieldDefaults LabelAlign="Right" LabelWidth="90" MsgTarget="Qtip" />
<Items>
<ext:Panel runat="server" Title="RadiosW - Using [NAME] in Defaults" Layout="HBoxLayout" Padding="10">
<Defaults>
<ext:Parameter Name="Name" Value="ccTypeW" />
</Defaults>
<Items>
<ext:Radio ID="RadioW1"
runat="server"
BoxLabel="VISA"
Checked="true" Flex="1"/>
<ext:Radio ID="RadioW2"
runat="server"
BoxLabel="MasterCard" Flex="1" />
<ext:Radio ID="RadioW3"
runat="server"
BoxLabel="American Express" Flex="1"/>
<ext:Radio ID="RadioW4"
runat="server"
BoxLabel="Discover" Flex="1"/>
</Items>
</ext:Panel>
<ext:Panel runat="server" Title="RadiosX [NAME] on each Radio (NoDefaults)" Layout="HBoxLayout" Padding="10">
<Items>
<ext:Radio ID="RadioX1"
runat="server"
BoxLabel="VISA"
Checked="true" Name="ccTypeX" Flex="1"/>
<ext:Radio ID="RadioX2"
runat="server"
BoxLabel="MasterCard" Name="ccTypeX" Flex="1"/>
<ext:Radio ID="RadioX3"
runat="server"
BoxLabel="American Express" Name ="ccTypeX" Flex="1"/>
<ext:Radio ID="RadioX4"
runat="server"
BoxLabel="Discover" Name ="ccTypeX" Flex="1"/>
</Items>
</ext:Panel>
<ext:FieldSet runat="server" TItle="RadiosY - RadioGroup with NO ID -- using [NAME] in Defaults"
Layout ="AnchorLayout" DefaultAnchor="100%" Padding="10">
<Items>
<ext:RadioGroup runat="server" Anchor="none">
<%--ID="RadioTestGroup"--%>
<LayoutConfig>
<ext:CheckboxGroupLayoutConfig AutoFlex="false" />
</LayoutConfig>
<Defaults>
<ext:Parameter Name="Name" Value="ccTypeY" />
<ext:Parameter Name="style" Value="margin-right:15px;" />
</Defaults>
<Items>
<ext:Radio ID="RadioY1"
runat="server"
BoxLabel="VISA"
Checked="true"
InputValue="visa" />
<ext:Radio ID="RadioY2"
runat="server"
BoxLabel="MasterCard"
InputValue="mastercard"/>
<ext:Radio ID="RadioY3"
runat="server"
BoxLabel="American Express"
InputValue="amex"/>
<ext:Radio ID="RadioY4"
runat="server"
BoxLabel="Discover"
InputValue="discover"/>
</Items>
</ext:RadioGroup>
</Items>
</ext:FieldSet>
<ext:FieldSet runat="server" TItle="RadiosZ - RadioGroup with ID - NoDefaults and no [NAME]"
Layout ="AnchorLayout" DefaultAnchor="100%" Padding="10">
<Items>
<ext:RadioGroup ID="RadioTestZGroup" runat="server" Anchor="none">
<LayoutConfig>
<ext:CheckboxGroupLayoutConfig AutoFlex="false" />
</LayoutConfig>
<%--<Defaults>
<ext:Parameter Name="Name" Value="ccTypeZ" />
<ext:Parameter Name="style" Value="margin-right:15px;" />
</Defaults>--%>
<Items>
<ext:Radio ID="RadioZ1"
runat="server"
BoxLabel="VISA"
Checked="true" />
<ext:Radio ID="RadioZ2"
runat="server"
BoxLabel="MasterCard"/>
<ext:Radio ID="RadioZ3"
runat="server"
BoxLabel="American Express" />
<ext:Radio ID="RadioZ4"
runat="server"
BoxLabel="Discover" />
</Items>
</ext:RadioGroup>
</Items>
</ext:FieldSet>
<ext:FieldSet runat="server" TItle="RadiosA - RadioGroup with No ID - [NAME] on each Radio - Nodefaults"
Layout ="AnchorLayout" DefaultAnchor="100%" Padding="10">
<Items>
<ext:RadioGroup runat="server" Anchor="none">
<LayoutConfig>
<ext:CheckboxGroupLayoutConfig AutoFlex="false" />
</LayoutConfig>
<%--<Defaults>
<ext:Parameter Name="Name" Value="ccTypeZ" />
<ext:Parameter Name="style" Value="margin-right:15px;" />
</Defaults>--%>
<Items>
<ext:Radio ID="RadioA1"
runat="server"
BoxLabel="VISA"
Checked="true" Name ="ccTypeA" />
<ext:Radio ID="RadioA2"
runat="server"
BoxLabel="MasterCard" Name ="ccTypeA" />
<ext:Radio ID="RadioA3"
runat="server"
BoxLabel="American Express" Name ="ccTypeA" />
<ext:Radio ID="RadioA4"
runat="server"
BoxLabel="Discover" Name ="ccTypeA" />
</Items>
</ext:RadioGroup>
</Items>
</ext:FieldSet>
</Items>
<Buttons>
<ext:Button runat="server" Text="Test Radio (OnClick)" OnClick="TestRadio_OnClick">
</ext:Button>
<ext:Button runat="server" Text="Reset">
<Listeners>
<Click Handler="this.up('form').getForm().reset(); alert('Form Reset');"/>
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Complete Purchase" Width="150">
<Listeners>
<Click Handler="var form = this.up('form').getForm(); form.isValid() && Ext.MessageBox.alert('Submitted Values', form.getValues(true)); return true;" />
</Listeners>
<DirectEvents>
<Click OnEvent="CompletePurchase_ServerSideEvent"></Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>
<ext:Panel runat="server" Flex="1" Title="Debug Messages" Layout="FitLayout">
<Items>
<ext:TextArea runat="server" ID="TestMessage"></ext:TextArea>
</Items>
</ext:Panel>
</Items>
</ext:Container>
</Items>
</ext:Viewport>
</form>
</body>
</html>