Upgrade to ExtJS 3.2.1 - Released 04/27/2010
[extjs.git] / docs / output / Ext.form.Action.DirectSubmit.html
index 2c0a884..4d7491b 100644 (file)
@@ -1,5 +1,83 @@
-<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.form.Action.DirectSubmit-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-configs"><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>&#13;<a class="bookmark" href="../docs/?class=Ext.form.Action.DirectSubmit"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.form.Action.html" ext:member="" ext:cls="Ext.form.Action">Action</a>&#13;&nbsp;&nbsp;<img src="resources/elbow-end.gif"><a href="output/Ext.form.Action.Submit.html" ext:member="" ext:cls="Ext.form.Action.Submit">Action.Submit</a>&#13;&nbsp;&nbsp;&nbsp;&nbsp;<img src="resources/elbow-end.gif">Action.DirectSubmit</pre></div><h1>Class <a href="source/Action.html#cls-Ext.form.Action.DirectSubmit">Ext.form.Action.DirectSubmit</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.form</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">Action.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectSubmit">Action.DirectSubmit</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.form.Action.Submit.html" ext:cls="Ext.form.Action.Submit" ext:member="">Action.Submit</a></td></tr></table><div class="description">Provides Ext.direct support for submitting form data.
-See <a href="output/Ext.form.Action.DirectLoad.html" ext:cls="Ext.form.Action.DirectLoad">Ext.form.Action.DirectLoad</a>.</div><div class="hr"></div><a id="Ext.form.Action.DirectSubmit-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action.Submit-clientValidation"></a><b><a href="source/Action.html#cfg-Ext.form.Action.Submit-clientValidation">clientValidation</a></b> : boolean<div class="mdesc"><div class="short">Determines whether a Form's fields are validated
+<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.form.Action.DirectSubmit-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="inner-link" href="#Ext.form.Action.DirectSubmit-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>&#13;<a class="bookmark" href="../docs/?class=Ext.form.Action.DirectSubmit"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.form.Action.html" ext:member="" ext:cls="Ext.form.Action">Action</a>&#13;&nbsp;&nbsp;<img src="resources/elbow-end.gif"><a href="output/Ext.form.Action.Submit.html" ext:member="" ext:cls="Ext.form.Action.Submit">Action.Submit</a>&#13;&nbsp;&nbsp;&nbsp;&nbsp;<img src="resources/elbow-end.gif">Action.DirectSubmit</pre></div><h1>Class <a href="source/Action.html#cls-Ext.form.Action.DirectSubmit">Ext.form.Action.DirectSubmit</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.form</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectSubmit">Action.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Action.html#cls-Ext.form.Action.DirectSubmit">Action.DirectSubmit</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.form.Action.Submit.html" ext:cls="Ext.form.Action.Submit" ext:member="">Action.Submit</a></td></tr></table><div class="description"><p>Provides Ext.direct support for submitting form data.</p>
+<p>This example illustrates usage of Ext.Direct to <b>submit</b> a form through Ext.Direct.</p>
+<pre><code><b>var</b> myFormPanel = <b>new</b> Ext.form.FormPanel({
+    <i>// configs <b>for</b> FormPanel</i>
+    title: <em>'Basic Information'</em>,
+    renderTo: document.body,
+    width: 300, height: 160,
+    padding: 10,
+    buttons:[{
+        text: <em>'Submit'</em>,
+        handler: <b>function</b>(){
+            myFormPanel.getForm().submit({
+                params: {
+                    foo: <em>'bar'</em>,
+                    uid: 34
+                }
+            });
+        }
+    }],
+
+    <i>// configs apply to child items</i>
+    defaults: {anchor: <em>'100%'</em>},
+    defaultType: <em>'textfield'</em>,
+    items: [{
+        fieldLabel: <em>'Name'</em>,
+        name: <em>'name'</em>
+    },{
+        fieldLabel: <em>'Email'</em>,
+        name: <em>'email'</em>
+    },{
+        fieldLabel: <em>'Company'</em>,
+        name: <em>'company'</em>
+    }],
+
+    <i>// configs <b>for</b> BasicForm</i>
+    api: {
+        <i>// The server-side method to call <b>for</b> load() requests</i>
+        load: Profile.getBasicInfo,
+        <i>// The server-side must mark the submit handler as a <em>'formHandler'</em></i>
+        submit: Profile.updateBasicInfo
+    },
+    <i>// specify the order <b>for</b> the passed params</i>
+    paramOrder: [<em>'uid'</em>, <em>'foo'</em>]
+});</code></pre>
+The data packet sent to the server will resemble something like:
+<pre><code>{
+    <em>"action"</em>:<em>"Profile"</em>,<em>"method"</em>:<em>"updateBasicInfo"</em>,<em>"type"</em>:<em>"rpc"</em>,<em>"tid"</em>:<em>"6"</em>,
+    <em>"result"</em>:{
+        <em>"success"</em>:true,
+        <em>"id"</em>:{
+            <em>"extAction"</em>:<em>"Profile"</em>,<em>"extMethod"</em>:<em>"updateBasicInfo"</em>,
+            <em>"extType"</em>:<em>"rpc"</em>,<em>"extTID"</em>:<em>"6"</em>,<em>"extUpload"</em>:<em>"false"</em>,
+            <em>"name"</em>:<em>"Aaron Conran"</em>,<em>"email"</em>:<em>"aaron@extjs.com"</em>,<em>"company"</em>:<em>"Ext JS, LLC"</em>
+        }
+    }
+}</code></pre>
+The form will process a data packet returned by the server that is similar
+to the following:
+<pre><code><i>// sample success packet (batched requests)</i>
+[
+    {
+        <em>"action"</em>:<em>"Profile"</em>,<em>"method"</em>:<em>"updateBasicInfo"</em>,<em>"type"</em>:<em>"rpc"</em>,<em>"tid"</em>:3,
+        <em>"result"</em>:{
+            <em>"success"</em>:true
+        }
+    }
+]
+
+<i>// sample failure packet (one request)</i>
+{
+        <em>"action"</em>:<em>"Profile"</em>,<em>"method"</em>:<em>"updateBasicInfo"</em>,<em>"type"</em>:<em>"rpc"</em>,<em>"tid"</em>:<em>"6"</em>,
+        <em>"result"</em>:{
+            <em>"errors"</em>:{
+                <em>"email"</em>:<em>"already taken"</em>
+            },
+            <em>"success"</em>:false,
+            <em>"foo"</em>:<em>"bar"</em>
+        }
+}</code></pre>
+Also see the discussion in <a href="output/Ext.form.Action.DirectLoad.html" ext:cls="Ext.form.Action.DirectLoad">Ext.form.Action.DirectLoad</a>.</div><div class="hr"></div><a id="Ext.form.Action.DirectSubmit-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action.Submit-clientValidation"></a><b><a href="source/Action.html#cfg-Ext.form.Action.Submit-clientValidation">clientValidation</a></b> : boolean<div class="mdesc"><div class="short">Determines whether a Form's fields are validated
 in a final call to isValid prior to submission.
 Pass false in the Fo...</div><div class="long">Determines whether a Form's fields are validated
 in a final call to <a href="output/Ext.form.BasicForm.html#Ext.form.BasicForm-isValid" ext:member="isValid" ext:cls="Ext.form.BasicForm">isValid</a> prior to submission.
@@ -31,7 +109,8 @@ before the success callba...</div><div class="long">When set to <tt><b>true</b><
 <a href="output/Ext.form.BasicForm.reset.html" ext:cls="Ext.form.BasicForm.reset">reset</a> on Action success. If specified, this happens
 <b>before</b> the <a href="output/Ext.form.Action.html#Ext.form.Action-success" ext:member="success" ext:cls="Ext.form.Action">success</a> callback is called and before the Form's
 <a href="output/Ext.form.BasicForm.actioncomplete.html" ext:cls="Ext.form.BasicForm.actioncomplete">actioncomplete</a> event fires.</div></div></td><td class="msource"><a href="output/Ext.form.Action.html#reset" ext:member="#reset" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-scope"></a><b><a href="source/Action.html#cfg-Ext.form.Action-scope">scope</a></b> : Object<div class="mdesc">The scope in which to call the callback functions (The <tt>this</tt> reference
-for the callback functions).</div></td><td class="msource"><a href="output/Ext.form.Action.html#scope" ext:member="#scope" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-success"></a><b><a href="source/Action.html#cfg-Ext.form.Action-success">success</a></b> : Function<div class="mdesc"><div class="short">The function to call when a valid success return packet is recieved.
+for the callback functions).</div></td><td class="msource"><a href="output/Ext.form.Action.html#scope" ext:member="#scope" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-submitEmptyText"></a><b><a href="source/Action.html#cfg-Ext.form.Action-submitEmptyText">submitEmptyText</a></b> : Boolean<div class="mdesc">If set to <tt>true</tt>, the emptyText value will be sent with the form
+when it is submitted.  Defaults to <tt>true</tt>.</div></td><td class="msource"><a href="output/Ext.form.Action.html#submitEmptyText" ext:member="#submitEmptyText" ext:cls="Ext.form.Action">Action</a></td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.form.Action-success"></a><b><a href="source/Action.html#cfg-Ext.form.Action-success">success</a></b> : Function<div class="mdesc"><div class="short">The function to call when a valid success return packet is recieved.
 The function is passed the following parameters:...</div><div class="long">The function to call when a valid success return packet is recieved.
 The function is passed the following parameters:<ul class="mdetail-params">
 <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>