Aug 24, 2012, 10:46 AM
[CLOSED] Reset all fields in a panel
Hi,
I want to reset all fields in a panel.
To achieve this, I put the panel in a formPanel and I use the formPanel.getForm().reset() method.
This method works good in some cases, and does not work in other cases.
One of these cases is the following:
1- What is the problem?
2- Can I use the .getForm().reset() directly to a panel without placing the panel into a formPanel?
Thanks in advance for your help
I want to reset all fields in a panel.
To achieve this, I put the panel in a formPanel and I use the formPanel.getForm().reset() method.
This method works good in some cases, and does not work in other cases.
One of these cases is the following:
<ext:FormPanel ID="formPanel3" Border="false" runat="server" Height="250" AnchorHorizontal="100%">
<Content>
<ext:FieldSet Height="240" runat="server" Title="Current Address Information" Padding="10"
ID="fielaSetAddress" AnchorHorizontal="100" ButtonAlign="Right">
<Content>
<ext:Panel ID="panelAddressTopPanel" runat="server" Border="false">
<Content>
<ext:TableLayout ID="TableLayout11" runat="server" Columns="4">
<Cells>
<ext:Cell CellCls="styleOfTopTable">
<ext:DateField ID="DateFieldDateFrom" runat="server" FieldLabel="Date from*" Width="250"
LabelAlign="Right" LabelSeparator=" " AllowBlank="false">
<Listeners>
<Select Handler="dateOfBirth.setMaxValue(this.getValue());" />
</Listeners>
</ext:DateField>
</ext:Cell>
<ext:Cell CellCls="styleOfTopTable">
<ext:Button ID="btnResetCurrentAddress" Hidden="true" runat="server" Text="Reset current address"
Icon="ArrowRefresh">
<Listeners>
<Click Handler="formPanel3.getForm().reset(); this.hide(); btnAddMoreAddress.hide(); # {DirectMethods}.ResetCurrentAddress();" />
</Listeners>
</ext:Button>
</ext:Cell>
</Cells>
</ext:TableLayout>
</Content>
</ext:Panel>
<ext:Panel ID="panelAddressLowPanel" runat="server" Border="false">
<Content>
<ext:TableLayout ID="TableLayout2" Columns="3" runat="server">
<Cells>
<ext:Cell CellCls="styleOfCells">
<ext:ComboBox LabelSeparator=" " LabelAlign="Right" ID="comboBoxCountryAddress" runat="server"
StoreID="dsCountryAddress" Width="250" Editable="true" DisplayField="getCountryName"
FieldLabel="Country*" AllowBlank="false" ValueField="getId" TypeAhead="true"
Mode="Local" ForceSelection="true" TriggerAction="All" EmptyText="Select a country..."
ItemSelector="div.list-item" SelectOnFocus="false" LazyInit="false">
<Template ID="TemplateCountryAddress" runat="server">
<Html>
<tpl for=".">
<div class="list-item">
<h3>{getCountryName}</h3>
{getCcFips}, {getCcIso}
</div>
</tpl>
</Html>
</Template>
<Listeners>
<Select Handler=" #{DirectMethods}.LoadCitiesStoreAddress(); txtOtherCityAddress.disable(); txtOtherCityAddress.setValue(' '); txtOtherCityAddress.allowBlank = true; txtOtherCityAddress.label.update('Other city'); comboBoxCityAddress.allowBlank=false; comboBoxCityAddress.label.update('City*'); comboBoxCityAddress.clearValue(); " />
</Listeners>
</ext:ComboBox>
</ext:Cell>
<ext:Cell CellCls="styleOfCells">
<ext:TextField LabelSeparator=" " Width="250" LabelAlign="Right" ID="txtZipPostalCode"
runat="server" FieldLabel="ZIP/Postal Code" />
</ext:Cell>
<ext:Cell CellCls="styleOfCells">
<ext:SpinnerField LabelSeparator=" " LabelAlign="Right" ID="txtFloor" Width="150"
Text="0" runat="server" FieldLabel="Floor" MinValue="-5" MaxValue="500" />
</ext:Cell>
</Cells>
</ext:TableLayout>
</Content>
</ext:Panel>
</Content>
</ext:FieldSet>
</Content>
</ext:FormPanel>
I have two questions:1- What is the problem?
2- Can I use the .getForm().reset() directly to a panel without placing the panel into a formPanel?
Thanks in advance for your help
Last edited by Daniil; Aug 28, 2012 at 5:18 PM.
Reason: [CLOSED]