[CLOSED] AllowBlank="false" problem when reopen the window

  1. #1

    [CLOSED] AllowBlank="false" problem when reopen the window

    there is a window which contains textfield with AllowBlank="false" and a close button in the page.

    first I open the window ,then click "save" button to close the window , then click "click me" to open the window, the textfield is show a red border. AllowBlank="false" works.

    how to avoid it validate the textfield's text when reopen the window.

    how to open the window every time as the window is open at the first time?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="TobrosCWT.BasicInfoSetup.WebForm2" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <script runat="server">
            protected void Unnamed_Event(object sender, DirectEventArgs e)
            {
                tfSupplierCode.Text = "";
                tfAreaCode.Text = "";
                tfSupplierCode.Text = "";
                tfSupplierForshort.Text = "";
                contomSetupWindow.Show();
            }
    
            protected void btnSave_Event(object sender, DirectEventArgs e)
            {
                contomSetupWindow.Close();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server"></ext:ResourceManager>
            <div>
                <ext:Button runat="server" Text="click me!">
                    <DirectEvents>
                        <Click OnEvent="Unnamed_Event"></Click>
                    </DirectEvents>
                </ext:Button>
                <ext:Window ID="contomSetupWindow" runat="server" Width="538" Height="200" BodyPadding="6" Modal="true" Resizable="false">
                    <LayoutConfig>
                        <ext:VBoxLayoutConfig Align="Stretch"></ext:VBoxLayoutConfig>
                    </LayoutConfig>
                    <Items>
                        <ext:FormPanel ID="formSupplier" runat="server" BaseCls="x-plain">
                            <LayoutConfig>
                                <ext:HBoxLayoutConfig Align="Stretch" DefaultMargins="0 10 0 0"></ext:HBoxLayoutConfig>
                            </LayoutConfig>
                            <Listeners>
                                <ValidityChange Handler="#{btnSave}.setDisabled(!valid);" />
                            </Listeners>
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" BaseCls="x-plain">
                                    <LayoutConfig>
                                        <ext:VBoxLayoutConfig Align="Stretch"></ext:VBoxLayoutConfig>
                                    </LayoutConfig>
                                    <Defaults>
                                        <ext:Parameter Name="LabelWidth" Value="90"></ext:Parameter>
                                        <ext:Parameter Name="Width" Value="250"></ext:Parameter>
                                    </Defaults>
                                    <Items>
                                        <ext:TextField ID="tfSupplierCode" runat="server" FieldLabel="supplierCode" AllowBlank="false"></ext:TextField>
                                        <ext:TextField ID="tfSupplierForshort" runat="server" FieldLabel="supplierForshort" AllowBlank="false"></ext:TextField>
                                        <ext:TextField ID="tfAreaCode" runat="server" FieldLabel="areacode"></ext:TextField>
                                        <ext:TextField ID="tfAddress" runat="server" FieldLabel="address"></ext:TextField>
                                    </Items>
                                </ext:Panel>
                            </Items>
                            <Buttons>
                                <ext:Button ID="btnSave" runat="server" Disabled="true" Icon="DatabaseSave" Text="save" FormBind="true">
                                    <DirectEvents>
                                        <Click OnEvent="btnSave_Event"></Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Buttons>
                        </ext:FormPanel>
                    </Items>
                </ext:Window>
            </div>
        </form>
    </body>
    </html>
    Last edited by Daniil; May 14, 2013 at 3:37 AM. Reason: [CLOSED]
  2. #2
    Hi @hdsoso,

    I would call a FormPanel's Reset method.
    formSupplier.Reset();
    contomSetupWindow.Show();
    and remove
    tfSupplierCode.Text = "";
    and others.

Similar Threads

  1. [CLOSED] Problem to use property "Maximized" from "Window"
    By avante in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 22, 2013, 12:47 AM
  2. Replies: 0
    Last Post: Aug 28, 2012, 5:05 PM
  3. TextBox wit AllowBlank="False" and VType
    By inaltec in forum 1.x Help
    Replies: 2
    Last Post: Jul 25, 2012, 4:42 PM
  4. [CLOSED] DropDownField with AllowBlank="false" issue
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 23, 2011, 11:56 AM
  5. Replies: 3
    Last Post: Dec 15, 2010, 2:07 PM

Posting Permissions