Apr 22, 2013, 12:40 PM
[CLOSED] Problem updating a form with a RadioGroup
Hi,
My question is related to http://forums.ext.net/showthread.php...g-a-form/page2. What's the right way of committing changes to a form with no record attached containing a RadioGroup control?
I've tried the following test case but it doesn't seem to be working. The values aren't updated for the RadioGroup control and its behavior overall doesn't look consistent with other form fields. For example, the call to display the form's values doesn't even include the RadioGroup fields if they aren't set. Am I missing some configuration settings?
My question is related to http://forums.ext.net/showthread.php...g-a-form/page2. What's the right way of committing changes to a form with no record attached containing a RadioGroup control?
I've tried the following test case but it doesn't seem to be working. The values aren't updated for the RadioGroup control and its behavior overall doesn't look consistent with other form fields. For example, the call to display the form's values doesn't even include the RadioGroup fields if they aren't set. Am I missing some configuration settings?
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
}
}
</script>
<!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>FormPanel - Ext.NET Examples</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Panel ID="Panel1" runat="server" Width="800" Height="600">
<Items>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<Center>
<ext:FormPanel ID="FormPanel1" runat="server" Title="Form Panel" Padding="5" ButtonAlign="Right"
TrackResetOnLoad="true">
<Items>
<ext:TextField ID="CompanyField" DataIndex="company" runat="server" FieldLabel="Company"
AnchorHorizontal="95%" />
<ext:TextField ID="PriceField" DataIndex="price" runat="server" FieldLabel="Price"
AnchorHorizontal="95%" />
<ext:TextField ID="ChangeField" DataIndex="change" runat="server" FieldLabel="Change"
AnchorHorizontal="95%" />
<ext:TextField ID="PctChangeField" DataIndex="pctChange" runat="server" FieldLabel="Change (%)"
AnchorHorizontal="95%" />
<ext:DateField ID="lastChange" runat="server" FieldLabel="Last Updated" AnchorHorizontal="95%" />
<ext:RadioGroup ID="RadioGroup1" runat="server" FieldLabel="My Options" AnchorHorizontal="95%">
<Items>
<ext:Radio ID="Radio1" runat="server" BoxLabel="Option 1"
InputValue="Option1">
</ext:Radio>
<ext:Radio ID="Radio2" runat="server" BoxLabel="Option 2" InputValue="Option2">
</ext:Radio>
</Items>
</ext:RadioGroup>
</Items>
<Buttons>
<ext:Button runat="server" Text="Save Form">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().setValues(#{FormPanel1}.getForm().getFieldValues());" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Reset Fields">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().reset();" />
</Listeners>
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Get Values...">
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Text="Object">
<Listeners>
<Click Handler="alert(Ext.encode(#{FormPanel1}.getForm().getValues()));" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem ID="MenuItem2" runat="server" Text="String">
<Listeners>
<Click Handler="alert(#{FormPanel1}.getForm().getValues(true));" />
</Listeners>
</ext:MenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Center>
</ext:BorderLayout>
</Items>
</ext:Panel>
</form>
</body>
</html>
Last edited by Daniil; Apr 24, 2013 at 1:02 PM.
Reason: [CLOSED]