Feb 02, 2010, 6:43 AM
Problem with TextField in Window
Friends,
I need your help, I have a user control with a window, this takes the information sent from a page, when I save the information, text field is blank, can you help?.
Thank you.
Here the complete code, thanks.
BasicConfig.aspx
I need your help, I have a user control with a window, this takes the information sent from a page, when I save the information, text field is blank, can you help?.
Thank you.
Here the complete code, thanks.
BasicConfig.aspx
...
<%@ Register src="~/UserControls/wucParamwindow.ascx" tagname="wucParamWindow" tagprefix="uc1" %>
<asp:Content ID="ContentEBusiness" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<ext:TabPanel ID="tbpConfiguration" runat="server" ActiveTabIndex="0"
Frame="True" Height="700px">
<tabs>
<ext:Tab ID="tbDepartament" runat="server" Title="Departamentos" Frame="true" Icon="ApplicationViewTile">
<body>
<ext:Store ID="StoreDepartament" runat="server" AutoDataBind="true" AutoLoad="true" OnRefreshData="StoreDepartament_RefreshData">
</ext:Store>
<ext:GridPanel ID="GridDepartament" runat="server" ...>
<ColumnModel ID="ctl366" IDMode="Legacy">
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelDepartament" runat="server" SingleSelect="true" />
</SelectionModel>
<BottomBar>
<ext:PagingToolBar ID="ptbDepartament" runat="server" PageSize="20" />
</BottomBar>
<Buttons>
<ext:Button ID="bAddDepartament" runat="server" Text="Agregar" Icon="Add">
<AjaxEvents>
<Click OnEvent="ShowParamWindow"></Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="bEditDepartament" runat="server" Text="Editar" Icon="NoteEdit">
<AjaxEvents>
<Click OnEvent="ShowParamWindow"></Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="bDeleteDepartament" runat="server" Text="Eliminar" Icon="Delete"></ext:Button>
</Buttons>
</ext:GridPanel>
</body>
</ext:Tab>
</tabs>
</ext:TabPanel>
<uc1:wucParamWindow ID="wucParamWindow1" runat="server" />
</asp:Content>
BasicConfig.aspx.csusing System;
...
public partial class BasicConfig : System.Web.UI.Page
{
public void ShowParamWindow(object sender, AjaxEventArgs e)
{
Coolite.Ext.Web.Button bParent = (Coolite.Ext.Web.Button)sender;
this.wucParamWindow1.Show(1,2,EParameterType.DEPARTAMENT,EActionType.INSERT);
}
}
wucParamwindow.ascx
<ext:Window ID="winParam" runat="server" Icon="Application" Title="Valor"
Closable="False" Height="150px" Width="350px" Modal="True"
AutoRender="False">
<Body>
<ext:FormPanel ID="fpParam" runat="server" BodyStyle="padding:5px;" ButtonAlign="Right"
Frame="true" Height="100px" LabelWidth="50" Width="340px">
<Body>
<ext:FormLayout ID="flParam" runat="server">
<ext:Anchor Horizontal="90%">
<ext:TextField ID="txtParamName" runat="server" FieldLabel="Valor">
</ext:TextField>
</ext:Anchor>
<ext:Anchor Horizontal="90%">
<ext:TextField ID="hdnParent" runat="server" />
</ext:Anchor>
</ext:FormLayout>
</Body>
</ext:FormPanel>
</Body>
<Buttons>
<ext:Button runat="server" ID="bPrmSave" Text="Grabar" Icon="Disk">
<AjaxEvents >
<Click OnEvent="bPrmSave_Click">
<EventMask ShowMask="true" Msg="Verifying..." MinDelay="500" />
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
</ext:Window>
wucParamwindow.ascx.csusing System;
....
public partial class wucParamWindow : System.Web.UI.UserControl
{
public void Show(int companyId, int fieldId, EParameterType parameterType, EActionType actionType)
{
this.winParam.Show();
//Here, take the parameters are set correctly and to hdnParent
this.hdnParent.Text = string.Format("{0};{1};{2};{3}", companyId, fieldId, Convert.ToInt32(parameterType), Convert.ToInt32(actionType));
}
protected void bPrmSave_Click(object sender, EventArgs e)
{
string[] arrInfo = this.hdnParent.Text.Split(';');//Here, hdnParent is blank
ParameterBridge parameterBridge = new ParameterBridge();
parameterBridge.InsertParameter(Convert.ToInt32(arrInfo[0]),
Convert.ToInt32(arrInfo[1]),
this.txtParamName.Text,//Here, hdnParent is blank
(EParameterType)Convert.ToInt32(arrInfo[2]),
(EActionType)Convert.ToInt32(arrInfo[3]));
}
}