[CLOSED] FormPanel not validate a TextField after show with allowBlank = "false"

  1. #1

    [CLOSED] FormPanel not validate a TextField after show with allowBlank = "false"

    Hi, I have the next problem, I have a FormPanel with a Button, the Button is Enabled when de FormPanel is valid, but I have a ComboBox with a Items, when I select the item "OTRO" a TextField2 is show, the TextField2 has a property AllowBlank="true", but when is show it has AllowBlank="false" from JavaScript, the problem is, when I show the TextField2 has blank text, but the FormPanel in ValidityChange is not working, this is my example:

            <ext:FormPanel
                ID="FormPanel1"
                runat="server"
                ButtonAlign="Right"
                Height="185"
                Padding="5"
                Title="Title"
                Width="300">
                <Items>
                    <ext:TextField
                        ID="TextField1"
                        runat="server"
                        AnchorHorizontal="100%"
                        FieldLabel="Label"
                        AllowBlank="false">
                    </ext:TextField>
                <ext:ComboBox
                    ID="cmbTipoParticipante"
                    runat="server"
                    AnchorHorizontal="100%"
                    AllowBlank="False"
                    QueryMode="Local"
                    TypeAhead="True"
                    ForceSelection="true"
                    MarginSpec="10px 0px 0px 10px"
                    EmptyText="Tipo participante"
                    Editable="False">
                    <ListConfig Cls="comboBoxCustom">
                    </ListConfig>
                    <Listeners>
                        <Select Fn="cmbTipoParticipante_Select" />
                    </Listeners>
                    <Items>
                        <ext:ListItem Text="PRODUCTOR" Value="1" />
                        <ext:ListItem Text="EXPOSITOR" Value="2" />
                        <ext:ListItem Text="PATROCINADOR" Value="3" />
                        <ext:ListItem Text="CONFERENCISTA" Value="4" />
                        <ext:ListItem Text="ASISTENTE POR PARTE DE UNA EMPRESA" Value="5" />
                        <ext:ListItem Text="INVESTIGADOR" Value="6" />
                        <ext:ListItem Text="OTRO" Value="7" />
                    </Items>
                </ext:ComboBox>
                    <ext:TextField
                        ID="TextField2"
                        runat="server"
                        AnchorHorizontal="100%"
                        FieldLabel="Label"
                        AllowBlank="true"
                        Hidden="true">
                    </ext:TextField>
                </Items>
                <Listeners>
                    <ValidityChange Handler="this.dockedItems.get(1).setStatus({
                                                    text : valid ? 'La informaci?n esta completa/correcta' : 'Existen informaci?n incompleta/incorrecta', 
                                                    iconCls: valid ? 'icon-accept' : 'icon-exclamation'
                                                });
                                                #{Button1}.setDisabled(!valid);" />
                </Listeners>
                <BottomBar>
                    <ext:StatusBar ID="sbRegistro" runat="server" />
                </BottomBar>
                <Buttons>
                    <ext:Button
                        ID="Button1"
                        runat="server"
                        Icon="Disk"
                        Text="Submit"
                        Disabled="true">
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
            var cmbTipoParticipante_Select = function (combo, records) {
                //6. Validaci?n para mostrar el campo de especificar otro tipo de participante
                if (records[0].get('field1') === '7') {
                    App.TextField2.allowBlank = false;
                    App.TextField2.show();
                    App.TextField2.focus(false, 50);
                }
            };

    When I Select the item "PRODUCTOR" is showing the button in enabled




    But, after I select the item "OTRO" is showing the button in enabled, I want that the Listener ValidityChange is working because I set the allowBlank = 'true' in the TextField2.



    Could you please help me?

    Thnak you
    Attached Thumbnails Click image for larger version. 

Name:	ErrorValidate01.png 
Views:	64 
Size:	4.2 KB 
ID:	13891   Click image for larger version. 

Name:	ErrorValidate02.png 
Views:	64 
Size:	4.3 KB 
ID:	13901  
    Last edited by Daniil; Aug 08, 2014 at 9:05 AM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    If you change some validation property like AllowBlank on the fly, you should re-validate to get that change taken into account.

    I would try this:
    App.TextField2.allowBlank = false;
    App.TextField2.validate();

Similar Threads

  1. Replies: 1
    Last Post: May 13, 2013, 2:40 PM
  2. [CLOSED] AllowBlank="false" problem when reopen the window
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 08, 2013, 11:30 AM
  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

Tags for this Thread

Posting Permissions