[CLOSED] Submit FormPanel values via AjaxEvent

  1. #1

    [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>
  2. #2

    RE: [CLOSED] Submit FormPanel values via AjaxEvent

    Hi,

    The FormPanel is still under development. In classic ASP.NET pages the FormPanel doesn't render own form because one form (FormPanel form) can't be nested to another (ASP.NET form). Therefore all specefic js functions of FormPanel is not working. Just make simply AjaxEvent (for examle Coolite Button with AjaxEvent click) and all fields will be submitted to the server automatically

  3. #3

    RE: [CLOSED] Submit FormPanel values via AjaxEvent



    Thanks for the reply.

    Where exactly do I need to place the button for the Form's values to be automatically submitted via an AjaxEvent? I've tried moving the button within the FormPanel itself, but the values still aren't submitted as ExtraParams?

    Thanks.
  4. #4

    RE: [CLOSED] Submit FormPanel values via AjaxEvent

    Hi,

    Button can be placed anywhere. The values will be submitted automatically and can be available through own server side variables (they will not be presented in ExtraParams)

    TextField1.Text and etc
  5. #5

    RE: [CLOSED] Submit FormPanel values via AjaxEvent



    Oops, so they are. Thanks again!

Similar Threads

  1. How to Submit FormPanel Data
    By abhijit in forum 1.x Help
    Replies: 3
    Last Post: Feb 24, 2012, 7:18 AM
  2. [CLOSED] Partial View & FormPanel Submit
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 14, 2011, 12:01 PM
  3. Replies: 3
    Last Post: Mar 25, 2011, 9:55 AM
  4. [CLOSED] FormPanel: Execute all events on the form before submit it
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 13, 2010, 1:27 PM
  5. Formpanel.submit() shows javascript error
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Jul 10, 2010, 1:16 PM

Posting Permissions