commit extjs-2.2.1
[extjs.git] / docs / output / Ext.form.Action.Load.html
1         <div class="body-wrap">
2         <div class="top-tools">
3             <a class="inner-link" href="#Ext.form.Action.Load-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4             <a class="inner-link" href="#Ext.form.Action.Load-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5             <a class="inner-link" href="#Ext.form.Action.Load-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                             <a class="inner-link" href="#Ext.form.Action.Load-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                         <a class="bookmark" href="../docs/?class=Ext.form.Action.Load"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8         </div>
9                 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.form.Action" ext:member="" href="output/Ext.form.Action.html">Action</a>
11   <img src="resources/elbow-end.gif"/>Action.Load</pre></div>
12                 <h1>Class Ext.form.Action.Load</h1>
13         <table cellspacing="0">
14             <tr><td class="label">Package:</td><td class="hd-info">Ext.form</td></tr>
15             <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Action.js" target="_blank">Action.js</a></td></tr>
16             <tr><td class="label">Class:</td><td class="hd-info">Action.Load</td></tr>
17                                     <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.form.Action" ext:member="" href="output/Ext.form.Action.html">Action</a></td></tr>
18                     </table>
19         <div class="description">
20             <p>A class which handles loading of data from a server into the Fields of an <a ext:cls="Ext.form.BasicForm" href="output/Ext.form.BasicForm.html">Ext.form.BasicForm</a>.</p>
21 <p>Instances of this class are only created by a <a ext:cls="Ext.form.BasicForm" href="output/Ext.form.BasicForm.html">Form</a> when
22 <a ext:cls="Ext.form.BasicForm" ext:member="load" href="output/Ext.form.BasicForm.html#load">load</a>ing.</p>
23 <p>A response packet <b>must</b> contain a boolean <tt style="font-weight:bold">success</tt> property, and
24 a <tt style="font-weight:bold">data</tt> property. The <tt style="font-weight:bold">data</tt> property
25 contains the values of Fields to load. The individual value object for each Field
26 is passed to the Field's <a ext:cls="Ext.form.Field" ext:member="setValue" href="output/Ext.form.Field.html#setValue">setValue</a> method.</p>
27 <p>By default, response packets are assumed to be JSON, so a typical response
28 packet may look like this:</p><pre><code>{
29     success: true,
30     data: {
31         clientName: <em>"Fred. Olsen Lines"</em>,
32         portOfLoading: <em>"FXT"</em>,
33         portOfDischarge: <em>"OSL"</em>
34     }
35 }</code></pre>
36 <p>Other data may be placed into the response for processing the <a ext:cls="Ext.form.BasicForm" href="output/Ext.form.BasicForm.html">Form</a>'s callback
37 or event handler methods. The object decoded from this JSON is available in the <a ext:cls="Ext.form.Action.Load" ext:member="result" href="output/Ext.form.Action.Load.html#result">result</a> property.</p>        </div>
38         
39         <div class="hr"></div>
40                 <a id="Ext.form.Action.Load-configs"></a>
41         <h2>Config Options</h2>
42         <table cellspacing="0" class="member-table">
43             <tr>
44                 <th class="sig-header" colspan="2">Config Options</th>
45                 <th class="msource-header">Defined By</th>
46             </tr>
47                 <tr class="config-row inherited expandable">\r
48         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
49         <td class="sig">\r
50         <a id="Ext.form.Action.Load-failure"></a>\r
51             <b>failure</b> : Function            <div class="mdesc">\r
52                         <div class="short">The function to call when a failure packet was recieved, or when an error ocurred in the Ajax communication. The func...</div>\r
53             <div class="long">\r
54                 The function to call when a failure packet was recieved, or when an error ocurred in the Ajax communication. 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> <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. If an Ajax error ocurred, the failure type will be in <a ext:cls="Ext.form.Action" ext:member="failureType" href="output/Ext.form.Action.html#failureType">failureType</a>. The <a ext:cls="Ext.form.Action" ext:member="result" href="output/Ext.form.Action.html#result">result</a> property of this object may be examined to perform custom postprocessing.</div></li> </ul>            </div>\r
55                         </div>\r
56         </td>\r
57         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#failure" href="output/Ext.form.Action.html#failure">Action</a></td>\r
58     </tr>\r
59         <tr class="config-row inherited alt expandable">\r
60         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
61         <td class="sig">\r
62         <a id="Ext.form.Action.Load-method"></a>\r
63             <b>method</b> : String            <div class="mdesc">\r
64                         <div class="short">The HTTP method to use to access the requested URL. Defaults to the Ext.form.BasicForm's method, or if that is not sp...</div>\r
65             <div class="long">\r
66                 The HTTP method to use to access the requested URL. Defaults to the <a ext:cls="Ext.form.BasicForm" href="output/Ext.form.BasicForm.html">Ext.form.BasicForm</a>'s method, or if that is not specified, the underlying DOM form's method.            </div>\r
67                         </div>\r
68         </td>\r
69         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#method" href="output/Ext.form.Action.html#method">Action</a></td>\r
70     </tr>\r
71         <tr class="config-row inherited expandable">\r
72         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
73         <td class="sig">\r
74         <a id="Ext.form.Action.Load-params"></a>\r
75             <b>params</b> : Mixed            <div class="mdesc">\r
76                         <div class="short">Extra parameter values to pass. These are added to the Form's Ext.form.BasicForm.baseParams and passed to the specifi...</div>\r
77             <div class="long">\r
78                 Extra parameter values to pass. These are added to the Form's <a ext:cls="Ext.form.BasicForm" ext:member="baseParams" href="output/Ext.form.BasicForm.html#baseParams">Ext.form.BasicForm.baseParams</a> and passed to the specified URL along with the Form's input fields.            </div>\r
79                         </div>\r
80         </td>\r
81         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#params" href="output/Ext.form.Action.html#params">Action</a></td>\r
82     </tr>\r
83         <tr class="config-row inherited alt expandable">\r
84         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
85         <td class="sig">\r
86         <a id="Ext.form.Action.Load-reset"></a>\r
87             <b>reset</b> : Boolean            <div class="mdesc">\r
88                         <div class="short">When set to true, causes the Form to be reset on Action success. If specified, this happens before the success callba...</div>\r
89             <div class="long">\r
90                 When set to <tt><b>true</b></tt>, causes the Form to be <a ext:cls="Ext.form.BasicForm.reset" href="output/Ext.form.BasicForm.reset.html">reset</a> on Action success. If specified, this happens <b>before</b> the <a ext:cls="Ext.form.Action" ext:member="success" href="output/Ext.form.Action.html#success">success</a> callback is called and before the Form's <a ext:cls="Ext.form.BasicForm.actioncomplete" href="output/Ext.form.BasicForm.actioncomplete.html">actioncomplete</a> event fires.            </div>\r
91                         </div>\r
92         </td>\r
93         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#reset" href="output/Ext.form.Action.html#reset">Action</a></td>\r
94     </tr>\r
95         <tr class="config-row inherited">\r
96         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
97         <td class="sig">\r
98         <a id="Ext.form.Action.Load-scope"></a>\r
99             <b>scope</b> : Object            <div class="mdesc">\r
100                             The scope in which to call the callback functions (The <tt>this</tt> reference for the callback functions).                        </div>\r
101         </td>\r
102         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#scope" href="output/Ext.form.Action.html#scope">Action</a></td>\r
103     </tr>\r
104         <tr class="config-row inherited alt expandable">\r
105         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
106         <td class="sig">\r
107         <a id="Ext.form.Action.Load-success"></a>\r
108             <b>success</b> : Function            <div class="mdesc">\r
109                         <div class="short">The function to call when a valid success return packet is recieved. The function is passed the following parameters:...</div>\r
110             <div class="long">\r
111                 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> <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. The <a ext:cls="Ext.form.Action" ext:member="result" href="output/Ext.form.Action.html#result">result</a> property of this object may be examined to perform custom postprocessing.</div></li> </ul>            </div>\r
112                         </div>\r
113         </td>\r
114         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#success" href="output/Ext.form.Action.html#success">Action</a></td>\r
115     </tr>\r
116         <tr class="config-row inherited">\r
117         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
118         <td class="sig">\r
119         <a id="Ext.form.Action.Load-timeout"></a>\r
120             <b>timeout</b> : Number            <div class="mdesc">\r
121                             The number of milliseconds to wait for a server response before failing with the <a ext:cls="Ext.form.Action" ext:member="failureType" href="output/Ext.form.Action.html#failureType">failureType</a> as <a ext:cls="Ext.form.Action" ext:member="Action.CONNECT_FAILURE" href="output/Ext.form.Action.html#Action.CONNECT_FAILURE">Action.CONNECT_FAILURE</a>.                        </div>\r
122         </td>\r
123         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#timeout" href="output/Ext.form.Action.html#timeout">Action</a></td>\r
124     </tr>\r
125         <tr class="config-row inherited alt">\r
126         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
127         <td class="sig">\r
128         <a id="Ext.form.Action.Load-url"></a>\r
129             <b>url</b> : String            <div class="mdesc">\r
130                             The URL that the Action is to invoke.                        </div>\r
131         </td>\r
132         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#url" href="output/Ext.form.Action.html#url">Action</a></td>\r
133     </tr>\r
134         <tr class="config-row inherited">\r
135         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
136         <td class="sig">\r
137         <a id="Ext.form.Action.Load-waitMsg"></a>\r
138             <b>waitMsg</b> : String            <div class="mdesc">\r
139                             The message to be displayed by a call to <a ext:cls="Ext.MessageBox" ext:member="wait" href="output/Ext.MessageBox.html#wait">Ext.MessageBox.wait</a> during the time the action is being processed.                        </div>\r
140         </td>\r
141         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#waitMsg" href="output/Ext.form.Action.html#waitMsg">Action</a></td>\r
142     </tr>\r
143         <tr class="config-row inherited alt">\r
144         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
145         <td class="sig">\r
146         <a id="Ext.form.Action.Load-waitTitle"></a>\r
147             <b>waitTitle</b> : String            <div class="mdesc">\r
148                             The title to be displayed by a call to <a ext:cls="Ext.MessageBox" ext:member="wait" href="output/Ext.MessageBox.html#wait">Ext.MessageBox.wait</a> during the time the action is being processed.                        </div>\r
149         </td>\r
150         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#waitTitle" href="output/Ext.form.Action.html#waitTitle">Action</a></td>\r
151     </tr>\r
152             </table>
153                 <a id="Ext.form.Action.Load-props"></a>
154         <h2>Public Properties</h2>
155                 <table cellspacing="0" class="member-table">
156             <tr>
157                 <th class="sig-header" colspan="2">Property</th>
158                 <th class="msource-header">Defined By</th>
159             </tr>
160                 <tr class="property-row inherited expandable">\r
161         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
162         <td class="sig">\r
163         <a id="Ext.form.Action.Load-failureType"></a>\r
164             <b>failureType</b> : String            <div class="mdesc">\r
165                         <div class="short">The type of failure detected. See Ext.form.Action#Action.CLIENT_INVALID CLIENT_INVALID,
166 Ext.form.Action#Action.SERVER...</div>\r
167             <div class="long">\r
168                 The type of failure detected. See <a ext:cls="link" href="output/link.html">Ext.form.Action#Action.CLIENT_INVALID CLIENT_INVALID</a>,
169 <a ext:cls="link" href="output/link.html">Ext.form.Action#Action.SERVER_INVALID SERVER_INVALID</a>,
170 <a ext:cls="Ext.form.Action" ext:member="link" href="output/Ext.form.Action.html#link">Ext.form.ActionAction.CONNECT_FAILURE CONNECT_FAILURE</a>, {@link Ext.form.Action#Action.LOAD_FAILURE LOAD_FAILURE}            </div>\r
171                         </div>\r
172         </td>\r
173         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#failureType" href="output/Ext.form.Action.html#failureType">Action</a></td>\r
174     </tr>\r
175         <tr class="property-row inherited alt">\r
176         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
177         <td class="sig">\r
178         <a id="Ext.form.Action.Load-response"></a>\r
179             <b>response</b> : Object            <div class="mdesc">\r
180                             
181 The XMLHttpRequest object used to perform the action.                        </div>\r
182         </td>\r
183         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#response" href="output/Ext.form.Action.html#response">Action</a></td>\r
184     </tr>\r
185         <tr class="property-row inherited">\r
186         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
187         <td class="sig">\r
188         <a id="Ext.form.Action.Load-result"></a>\r
189             <b>result</b> : Object            <div class="mdesc">\r
190                             
191 The decoded response object containing a boolean <tt style="font-weight:bold">success</tt> property and
192 other, action-specific properties.                        </div>\r
193         </td>\r
194         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#result" href="output/Ext.form.Action.html#result">Action</a></td>\r
195     </tr>\r
196         <tr class="property-row inherited alt">\r
197         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
198         <td class="sig">\r
199         <a id="Ext.form.Action.Load-type"></a>\r
200             <b>type</b> : String            <div class="mdesc">\r
201                             
202 The type of action this Action instance performs.
203 Currently only "submit" and "load" are supported.                        </div>\r
204         </td>\r
205         <td class="msource"><a ext:cls="Ext.form.Action" ext:member="#type" href="output/Ext.form.Action.html#type">Action</a></td>\r
206     </tr>\r
207             </table>
208                 <a id="Ext.form.Action.Load-methods"></a>
209         <h2>Public Methods</h2>
210         <div class="no-members">This class has no public methods.</div>        <a id="Ext.form.Action.Load-events"></a>
211         <h2>Public Events</h2>
212         <div class="no-members">This class has no public events.</div>
213         </div>