PDA

View Full Version : [CLOSED] Get value RadioGroup Request Form



romeu
Feb 23, 2012, 5:19 PM
I need use RadioGroup, but i dont know when pegar o valor no request form.

my apllication is mvc

my method save, received o radiogroup with object and i dont get value selected.


how make to resolve this problem?

Daniil
Feb 24, 2012, 5:26 AM
Hi,

Please look at the example.

Example View

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 runat="server">
<title>Ext.Net.MVC Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:FormPanel ID="FormPanel1" runat="server" Url="/Test/Submit">
<Items>
<ext:TextField ID="TextField1" runat="server" Text="I am the TextField" />
<ext:RadioGroup runat="server" GroupName="Group1" ColumnsNumber="1" >
<Items>
<ext:Radio runat="server" InputValue="0" Checked="true" />
<ext:Radio runat="server" InputValue="1" />
</Items>
</ext:RadioGroup>
</Items>
</ext:FormPanel>
<ext:Button runat="server" Text="Submit">
<Listeners>
<Click Handler="#{FormPanel1}.submit();" />
</Listeners>
</ext:Button>
</body>
</html>

Example Controller Action

public ActionResult Submit(FormCollection values)
{
string textField = values["TextField1"];
string radioGroup = values["Group1"];

FormPanelResult r = new FormPanelResult();
r.Success = true;

return r;
}

romeu
Feb 25, 2012, 11:20 AM
This is great!!!!!

thanks!