Mar 12, 2009, 8:10 AM
[CLOSED] Submit FormPanel values via AjaxEvent
How can I submit the values of controls within a FormPanel via an AjaxEvent?
Looking at the ExtJS documentation, in theory I should be able to do the following to retrieve the values, however this doesn't work ("getValues" doesn't appear to exist, despite the ExtJS documentation saying it does - http://www.extjs.com/deploy/dev/docs...form.BasicForm):
Ext.encode(#{pnlDetails}.getForm('frmDetails').get Values())
I've got the following code at the moment:
<ext:Panel
Title="Details" Frame="true"
id="pnlDetails"
BodyStyle="padding: 6px; border: 1px solid #99bbe8;"
runat="server" AutoScroll="true">
<TopBar>
<ext:Toolbar ID="tlb1" runat="server">
<Items>
<ext:Button ID="Button3" runat="server" Text="Save" Icon="Disk">
<AjaxEvents>
<Click OnEvent="pnlDetails_Save" >
<EventMask ShowMask="true" Target="Page" Msg="Saving Details..." />
<ExtraParams>
<ext:Parameter Mode="Raw" Name="Data" Value="Ext.encode(#{pnlDetails}.getForm('frmDetails').getValues())" />
</ExtraParams>
</Click>
</AjaxEvents>
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="Save changes to this record" />
</ToolTips>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Body>
<ext:FormPanel ID="frmDetails" runat="server">
<ext:Anchor>
<ext:Hidden
id="hidDataID"
runat="server"></ext:Hidden>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:TextField
AllowBlank="false"
id="txtName"
runat="server"
FieldLabel="Name"></ext:TextField>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:ComboBox
id="cboTest"
runat="server"
FieldLabel="Test"
StoreID="storeTest"
AllowBlank="false"
Mode="Local"
DisplayField="TestValue"
ValueField="TestID"
TriggerAction="All"
ValueNotFoundText="Not found"></ext:ComboBox>
</ext:Anchor>
</ext:FormPanel>
</body>
</ext:Panel>