Aug 01, 2014, 12:05 AM
[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:
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
<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
Last edited by Daniil; Aug 08, 2014 at 9:05 AM.
Reason: [CLOSED]