3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.form.Action"></div>/**
\r
15 * @class Ext.form.Action
\r
16 * <p>The subclasses of this class provide actions to perform upon {@link Ext.form.BasicForm Form}s.</p>
\r
17 * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
\r
18 * the Form needs to perform an action such as submit or load. The Configuration options
\r
19 * listed for this class are set through the Form's action methods: {@link Ext.form.BasicForm#submit submit},
\r
20 * {@link Ext.form.BasicForm#load load} and {@link Ext.form.BasicForm#doAction doAction}</p>
\r
21 * <p>The instance of Action which performed the action is passed to the success
\r
22 * and failure callbacks of the Form's action methods ({@link Ext.form.BasicForm#submit submit},
\r
23 * {@link Ext.form.BasicForm#load load} and {@link Ext.form.BasicForm#doAction doAction}),
\r
24 * and to the {@link Ext.form.BasicForm#actioncomplete actioncomplete} and
\r
25 * {@link Ext.form.BasicForm#actionfailed actionfailed} event handlers.</p>
\r
27 Ext.form.Action = function(form, options){
\r
29 this.options = options || {};
\r
32 <div id="prop-Ext.form.Action-CLIENT_INVALID"></div>/**
\r
33 * Failure type returned when client side validation of the Form fails
\r
34 * thus aborting a submit action. Client side validation is performed unless
\r
35 * {@link #clientValidation} is explicitly set to <tt>false</tt>.
\r
39 Ext.form.Action.CLIENT_INVALID = 'client';
\r
40 <div id="prop-Ext.form.Action-SERVER_INVALID"></div>/**
\r
41 * <p>Failure type returned when server side processing fails and the {@link #result}'s
\r
42 * <tt style="font-weight:bold">success</tt> property is set to <tt>false</tt>.</p>
\r
43 * <p>In the case of a form submission, field-specific error messages may be returned in the
\r
44 * {@link #result}'s <tt style="font-weight:bold">errors</tt> property.</p>
\r
48 Ext.form.Action.SERVER_INVALID = 'server';
\r
49 <div id="prop-Ext.form.Action-CONNECT_FAILURE"></div>/**
\r
50 * Failure type returned when a communication error happens when attempting
\r
51 * to send a request to the remote server. The {@link #response} may be examined to
\r
52 * provide further information.
\r
56 Ext.form.Action.CONNECT_FAILURE = 'connect';
\r
57 <div id="prop-Ext.form.Action-LOAD_FAILURE"></div>/**
\r
58 * Failure type returned when the response's <tt style="font-weight:bold">success</tt>
\r
59 * property is set to <tt>false</tt>, or no field values are returned in the response's
\r
60 * <tt style="font-weight:bold">data</tt> property.
\r
64 Ext.form.Action.LOAD_FAILURE = 'load';
\r
66 Ext.form.Action.prototype = {
\r
67 <div id="cfg-Ext.form.Action-url"></div>/**
\r
68 * @cfg {String} url The URL that the Action is to invoke.
\r
70 <div id="cfg-Ext.form.Action-reset"></div>/**
\r
71 * @cfg {Boolean} reset When set to <tt><b>true</b></tt>, causes the Form to be
\r
72 * {@link Ext.form.BasicForm.reset reset} on Action success. If specified, this happens
\r
73 * <b>before</b> the {@link #success} callback is called and before the Form's
\r
74 * {@link Ext.form.BasicForm.actioncomplete actioncomplete} event fires.
\r
76 <div id="cfg-Ext.form.Action-method"></div>/**
\r
77 * @cfg {String} method The HTTP method to use to access the requested URL. Defaults to the
\r
78 * {@link Ext.form.BasicForm}'s method, or if that is not specified, the underlying DOM form's method.
\r
80 <div id="cfg-Ext.form.Action-params"></div>/**
\r
81 * @cfg {Mixed} params <p>Extra parameter values to pass. These are added to the Form's
\r
82 * {@link Ext.form.BasicForm#baseParams} and passed to the specified URL along with the Form's
\r
84 * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
\r
86 <div id="cfg-Ext.form.Action-timeout"></div>/**
\r
87 * @cfg {Number} timeout The number of seconds to wait for a server response before
\r
88 * failing with the {@link #failureType} as {@link #Action.CONNECT_FAILURE}. If not specified,
\r
89 * defaults to the configured <tt>{@link Ext.form.BasicForm#timeout timeout}</tt> of the
\r
90 * {@link Ext.form.BasicForm form}.
\r
92 <div id="cfg-Ext.form.Action-success"></div>/**
\r
93 * @cfg {Function} success The function to call when a valid success return packet is recieved.
\r
94 * The function is passed the following parameters:<ul class="mdetail-params">
\r
95 * <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
\r
96 * <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. The {@link #result}
\r
97 * property of this object may be examined to perform custom postprocessing.</div></li>
\r
100 <div id="cfg-Ext.form.Action-failure"></div>/**
\r
101 * @cfg {Function} failure The function to call when a failure packet was recieved, or when an
\r
102 * error ocurred in the Ajax communication.
\r
103 * The function is passed the following parameters:<ul class="mdetail-params">
\r
104 * <li><b>form</b> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
\r
105 * <li><b>action</b> : Ext.form.Action<div class="sub-desc">The Action class. If an Ajax
\r
106 * error ocurred, the failure type will be in {@link #failureType}. The {@link #result}
\r
107 * property of this object may be examined to perform custom postprocessing.</div></li>
\r
110 <div id="cfg-Ext.form.Action-scope"></div>/**
\r
111 * @cfg {Object} scope The scope in which to call the callback functions (The <tt>this</tt> reference
\r
112 * for the callback functions).
\r
114 <div id="cfg-Ext.form.Action-waitMsg"></div>/**
\r
115 * @cfg {String} waitMsg The message to be displayed by a call to {@link Ext.MessageBox#wait}
\r
116 * during the time the action is being processed.
\r
118 <div id="cfg-Ext.form.Action-waitTitle"></div>/**
\r
119 * @cfg {String} waitTitle The title to be displayed by a call to {@link Ext.MessageBox#wait}
\r
120 * during the time the action is being processed.
\r
123 <div id="prop-Ext.form.Action-type"></div>/**
\r
124 * The type of action this Action instance performs.
\r
125 * Currently only "submit" and "load" are supported.
\r
129 <div id="prop-Ext.form.Action-failureType"></div>/**
\r
130 * The type of failure detected will be one of these: {@link #CLIENT_INVALID},
\r
131 * {@link #SERVER_INVALID}, {@link #CONNECT_FAILURE}, or {@link #LOAD_FAILURE}. Usage:
\r
133 var fp = new Ext.form.FormPanel({
\r
138 handler: function(){
\r
139 if(fp.getForm().isValid()){
\r
140 fp.getForm().submit({
\r
141 url: 'form-submit.php',
\r
142 waitMsg: 'Submitting your data...',
\r
143 success: function(form, action){
\r
144 // server responded with success = true
\r
145 var result = action.{@link #result};
\r
147 failure: function(form, action){
\r
148 if (action.{@link #failureType} === Ext.form.Action.{@link #CONNECT_FAILURE}) {
\r
149 Ext.Msg.alert('Error',
\r
150 'Status:'+action.{@link #response}.status+': '+
\r
151 action.{@link #response}.statusText);
\r
153 if (action.failureType === Ext.form.Action.{@link #SERVER_INVALID}){
\r
154 // server responded with success = false
\r
155 Ext.Msg.alert('Invalid', action.{@link #result}.errormsg);
\r
163 handler: function(){
\r
164 fp.getForm().reset();
\r
168 * @property failureType
\r
171 <div id="prop-Ext.form.Action-response"></div>/**
\r
172 * The XMLHttpRequest object used to perform the action.
\r
173 * @property response
\r
176 <div id="prop-Ext.form.Action-result"></div>/**
\r
177 * The decoded response object containing a boolean <tt style="font-weight:bold">success</tt> property and
\r
178 * other, action-specific properties.
\r
183 // interface method
\r
184 run : function(options){
\r
188 // interface method
\r
189 success : function(response){
\r
193 // interface method
\r
194 handleResponse : function(response){
\r
198 // default connection failure
\r
199 failure : function(response){
\r
200 this.response = response;
\r
201 this.failureType = Ext.form.Action.CONNECT_FAILURE;
\r
202 this.form.afterAction(this, false);
\r
206 // shared code among all Actions to validate that there was a response
\r
207 // with either responseText or responseXml
\r
208 processResponse : function(response){
\r
209 this.response = response;
\r
210 if(!response.responseText && !response.responseXML){
\r
213 this.result = this.handleResponse(response);
\r
214 return this.result;
\r
217 // utility functions used internally
\r
218 getUrl : function(appendParams){
\r
219 var url = this.options.url || this.form.url || this.form.el.dom.action;
\r
221 var p = this.getParams();
\r
223 url = Ext.urlAppend(url, p);
\r
230 getMethod : function(){
\r
231 return (this.options.method || this.form.method || this.form.el.dom.method || 'POST').toUpperCase();
\r
235 getParams : function(){
\r
236 var bp = this.form.baseParams;
\r
237 var p = this.options.params;
\r
239 if(typeof p == "object"){
\r
240 p = Ext.urlEncode(Ext.applyIf(p, bp));
\r
241 }else if(typeof p == 'string' && bp){
\r
242 p += '&' + Ext.urlEncode(bp);
\r
245 p = Ext.urlEncode(bp);
\r
251 createCallback : function(opts){
\r
252 var opts = opts || {};
\r
254 success: this.success,
\r
255 failure: this.failure,
\r
257 timeout: (opts.timeout*1000) || (this.form.timeout*1000),
\r
258 upload: this.form.fileUpload ? this.success : undefined
\r
263 <div id="cls-Ext.form.Action.Submit"></div>/**
\r
264 * @class Ext.form.Action.Submit
\r
265 * @extends Ext.form.Action
\r
266 * <p>A class which handles submission of data from {@link Ext.form.BasicForm Form}s
\r
267 * and processes the returned response.</p>
\r
268 * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
\r
269 * {@link Ext.form.BasicForm#submit submit}ting.</p>
\r
270 * <p><u><b>Response Packet Criteria</b></u></p>
\r
271 * <p>A response packet may contain:
\r
272 * <div class="mdetail-params"><ul>
\r
273 * <li><b><code>success</code></b> property : Boolean
\r
274 * <div class="sub-desc">The <code>success</code> property is required.</div></li>
\r
275 * <li><b><code>errors</code></b> property : Object
\r
276 * <div class="sub-desc"><div class="sub-desc">The <code>errors</code> property,
\r
277 * which is optional, contains error messages for invalid fields.</div></li>
\r
279 * <p><u><b>JSON Packets</b></u></p>
\r
280 * <p>By default, response packets are assumed to be JSON, so a typical response
\r
281 * packet may look like this:</p><pre><code>
\r
285 clientCode: "Client not found",
\r
286 portOfLoading: "This field must not be null"
\r
289 * <p>Other data may be placed into the response for processing by the {@link Ext.form.BasicForm}'s callback
\r
290 * or event handler methods. The object decoded from this JSON is available in the
\r
291 * {@link Ext.form.Action#result result} property.</p>
\r
292 * <p>Alternatively, if an {@link #errorReader} is specified as an {@link Ext.data.XmlReader XmlReader}:</p><pre><code>
\r
293 errorReader: new Ext.data.XmlReader({
\r
295 success: '@success'
\r
301 * <p>then the results may be sent back in XML format:</p><pre><code>
\r
302 <?xml version="1.0" encoding="UTF-8"?>
\r
303 <message success="false">
\r
306 <id>clientCode</id>
\r
307 <msg><![CDATA[Code not found. <br /><i>This is a test validation message from the server </i>]]></msg>
\r
310 <id>portOfLoading</id>
\r
311 <msg><![CDATA[Port not found. <br /><i>This is a test validation message from the server </i>]]></msg>
\r
316 * <p>Other elements may be placed into the response XML for processing by the {@link Ext.form.BasicForm}'s callback
\r
317 * or event handler methods. The XML document is available in the {@link #errorReader}'s {@link Ext.data.XmlReader#xmlData xmlData} property.</p>
\r
319 Ext.form.Action.Submit = function(form, options){
\r
320 Ext.form.Action.Submit.superclass.constructor.call(this, form, options);
\r
323 Ext.extend(Ext.form.Action.Submit, Ext.form.Action, {
\r
324 <div id="cfg-Ext.form.Action.Submit-errorReader"></div>/**
\r
325 * @cfg {Ext.data.DataReader} errorReader <p><b>Optional. JSON is interpreted with
\r
326 * no need for an errorReader.</b></p>
\r
327 * <p>A Reader which reads a single record from the returned data. The DataReader's
\r
328 * <b>success</b> property specifies how submission success is determined. The Record's
\r
329 * data provides the error messages to apply to any invalid form Fields.</p>
\r
331 <div id="cfg-Ext.form.Action.Submit-clientValidation"></div>/**
\r
332 * @cfg {boolean} clientValidation Determines whether a Form's fields are validated
\r
333 * in a final call to {@link Ext.form.BasicForm#isValid isValid} prior to submission.
\r
334 * Pass <tt>false</tt> in the Form's submit options to prevent this. If not defined, pre-submission field validation
\r
341 var o = this.options;
\r
342 var method = this.getMethod();
\r
343 var isGet = method == 'GET';
\r
344 if(o.clientValidation === false || this.form.isValid()){
\r
345 Ext.Ajax.request(Ext.apply(this.createCallback(o), {
\r
346 form:this.form.el.dom,
\r
347 url:this.getUrl(isGet),
\r
349 headers: o.headers,
\r
350 params:!isGet ? this.getParams() : null,
\r
351 isUpload: this.form.fileUpload
\r
353 }else if (o.clientValidation !== false){ // client validation failed
\r
354 this.failureType = Ext.form.Action.CLIENT_INVALID;
\r
355 this.form.afterAction(this, false);
\r
360 success : function(response){
\r
361 var result = this.processResponse(response);
\r
362 if(result === true || result.success){
\r
363 this.form.afterAction(this, true);
\r
367 this.form.markInvalid(result.errors);
\r
369 this.failureType = Ext.form.Action.SERVER_INVALID;
\r
370 this.form.afterAction(this, false);
\r
374 handleResponse : function(response){
\r
375 if(this.form.errorReader){
\r
376 var rs = this.form.errorReader.read(response);
\r
379 for(var i = 0, len = rs.records.length; i < len; i++) {
\r
380 var r = rs.records[i];
\r
381 errors[i] = r.data;
\r
384 if(errors.length < 1){
\r
388 success : rs.success,
\r
392 return Ext.decode(response.responseText);
\r
397 <div id="cls-Ext.form.Action.Load"></div>/**
\r
398 * @class Ext.form.Action.Load
\r
399 * @extends Ext.form.Action
\r
400 * <p>A class which handles loading of data from a server into the Fields of an {@link Ext.form.BasicForm}.</p>
\r
401 * <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
\r
402 * {@link Ext.form.BasicForm#load load}ing.</p>
\r
403 * <p><u><b>Response Packet Criteria</b></u></p>
\r
404 * <p>A response packet <b>must</b> contain:
\r
405 * <div class="mdetail-params"><ul>
\r
406 * <li><b><code>success</code></b> property : Boolean</li>
\r
407 * <li><b><code>data</code></b> property : Object</li>
\r
408 * <div class="sub-desc">The <code>data</code> property contains the values of Fields to load.
\r
409 * The individual value object for each Field is passed to the Field's
\r
410 * {@link Ext.form.Field#setValue setValue} method.</div></li>
\r
412 * <p><u><b>JSON Packets</b></u></p>
\r
413 * <p>By default, response packets are assumed to be JSON, so for the following form load call:<pre><code>
\r
414 var myFormPanel = new Ext.form.FormPanel({
\r
415 title: 'Client and routing info',
\r
417 fieldLabel: 'Client',
\r
420 fieldLabel: 'Port of loading',
\r
421 name: 'portOfLoading'
\r
423 fieldLabel: 'Port of discharge',
\r
424 name: 'portOfDischarge'
\r
427 myFormPanel.{@link Ext.form.FormPanel#getForm getForm}().{@link Ext.form.BasicForm#load load}({
\r
428 url: '/getRoutingInfo.php',
\r
430 consignmentRef: myConsignmentRef
\r
432 failure: function(form, action) {
\r
433 Ext.Msg.alert("Load failed", action.result.errorMessage);
\r
437 * a <b>success response</b> packet may look like this:</p><pre><code>
\r
441 clientName: "Fred. Olsen Lines",
\r
442 portOfLoading: "FXT",
\r
443 portOfDischarge: "OSL"
\r
446 * while a <b>failure response</b> packet may look like this:</p><pre><code>
\r
449 errorMessage: "Consignment reference not found"
\r
451 * <p>Other data may be placed into the response for processing the {@link Ext.form.BasicForm Form}'s
\r
452 * callback or event handler methods. The object decoded from this JSON is available in the
\r
453 * {@link Ext.form.Action#result result} property.</p>
\r
455 Ext.form.Action.Load = function(form, options){
\r
456 Ext.form.Action.Load.superclass.constructor.call(this, form, options);
\r
457 this.reader = this.form.reader;
\r
460 Ext.extend(Ext.form.Action.Load, Ext.form.Action, {
\r
466 Ext.Ajax.request(Ext.apply(
\r
467 this.createCallback(this.options), {
\r
468 method:this.getMethod(),
\r
469 url:this.getUrl(false),
\r
470 headers: this.options.headers,
\r
471 params:this.getParams()
\r
476 success : function(response){
\r
477 var result = this.processResponse(response);
\r
478 if(result === true || !result.success || !result.data){
\r
479 this.failureType = Ext.form.Action.LOAD_FAILURE;
\r
480 this.form.afterAction(this, false);
\r
483 this.form.clearInvalid();
\r
484 this.form.setValues(result.data);
\r
485 this.form.afterAction(this, true);
\r
489 handleResponse : function(response){
\r
490 if(this.form.reader){
\r
491 var rs = this.form.reader.read(response);
\r
492 var data = rs.records && rs.records[0] ? rs.records[0].data : null;
\r
494 success : rs.success,
\r
498 return Ext.decode(response.responseText);
\r
504 <div id="cls-Ext.form.Action.DirectLoad"></div>/**
\r
505 * @class Ext.form.Action.DirectLoad
\r
506 * @extends Ext.form.Action.Load
\r
507 * <p>Provides Ext.direct support for loading form data.</p>
\r
508 * <p>This example illustrates usage of Ext.Direct to <b>load</b> a form through Ext.Direct.</p>
\r
510 var myFormPanel = new Ext.form.FormPanel({
\r
511 // configs for FormPanel
\r
512 title: 'Basic Information',
\r
513 renderTo: document.body,
\r
514 width: 300, height: 160,
\r
517 // configs apply to child items
\r
518 defaults: {anchor: '100%'},
\r
519 defaultType: 'textfield',
\r
521 fieldLabel: 'Name',
\r
524 fieldLabel: 'Email',
\r
527 fieldLabel: 'Company',
\r
531 // configs for BasicForm
\r
533 // The server-side method to call for load() requests
\r
534 load: Profile.getBasicInfo,
\r
535 // The server-side must mark the submit handler as a 'formHandler'
\r
536 submit: Profile.updateBasicInfo
\r
538 // specify the order for the passed params
\r
539 paramOrder: ['uid', 'foo']
\r
543 myFormPanel.getForm().load({
\r
544 // pass 2 arguments to server side getBasicInfo method (len=2)
\r
551 * The data packet sent to the server will resemble something like:
\r
555 "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
\r
556 "data":[34,"bar"] // note the order of the params
\r
560 * The form will process a data packet returned by the server that is similar
\r
561 * to the following format:
\r
565 "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2,
\r
569 "name":"Fred Flintstone",
\r
570 "company":"Slate Rock and Gravel",
\r
571 "email":"fred.flintstone@slaterg.com"
\r
578 Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, {
\r
579 constructor: function(form, opts) {
\r
580 Ext.form.Action.DirectLoad.superclass.constructor.call(this, form, opts);
\r
582 type : 'directload',
\r
585 var args = this.getParams();
\r
586 args.push(this.success, this);
\r
587 this.form.api.load.apply(window, args);
\r
590 getParams : function() {
\r
591 var buf = [], o = {};
\r
592 var bp = this.form.baseParams;
\r
593 var p = this.options.params;
\r
594 Ext.apply(o, p, bp);
\r
595 var paramOrder = this.form.paramOrder;
\r
597 for(var i = 0, len = paramOrder.length; i < len; i++){
\r
598 buf.push(o[paramOrder[i]]);
\r
600 }else if(this.form.paramsAsHash){
\r
605 // Direct actions have already been processed and therefore
\r
606 // we can directly set the result; Direct Actions do not have
\r
607 // a this.response property.
\r
608 processResponse : function(result) {
\r
609 this.result = result;
\r
613 success : function(response, trans){
\r
614 if(trans.type == Ext.Direct.exceptions.SERVER){
\r
617 Ext.form.Action.DirectLoad.superclass.success.call(this, response);
\r
621 <div id="cls-Ext.form.Action.DirectSubmit"></div>/**
\r
622 * @class Ext.form.Action.DirectSubmit
\r
623 * @extends Ext.form.Action.Submit
\r
624 * <p>Provides Ext.direct support for submitting form data.</p>
\r
625 * <p>This example illustrates usage of Ext.Direct to <b>submit</b> a form through Ext.Direct.</p>
\r
627 var myFormPanel = new Ext.form.FormPanel({
\r
628 // configs for FormPanel
\r
629 title: 'Basic Information',
\r
630 renderTo: document.body,
\r
631 width: 300, height: 160,
\r
635 handler: function(){
\r
636 myFormPanel.getForm().submit({
\r
645 // configs apply to child items
\r
646 defaults: {anchor: '100%'},
\r
647 defaultType: 'textfield',
\r
649 fieldLabel: 'Name',
\r
652 fieldLabel: 'Email',
\r
655 fieldLabel: 'Company',
\r
659 // configs for BasicForm
\r
661 // The server-side method to call for load() requests
\r
662 load: Profile.getBasicInfo,
\r
663 // The server-side must mark the submit handler as a 'formHandler'
\r
664 submit: Profile.updateBasicInfo
\r
666 // specify the order for the passed params
\r
667 paramOrder: ['uid', 'foo']
\r
670 * The data packet sent to the server will resemble something like:
\r
673 "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
\r
677 "extAction":"Profile","extMethod":"updateBasicInfo",
\r
678 "extType":"rpc","extTID":"6","extUpload":"false",
\r
679 "name":"Aaron Conran","email":"aaron@extjs.com","company":"Ext JS, LLC"
\r
684 * The form will process a data packet returned by the server that is similar
\r
685 * to the following:
\r
687 // sample success packet (batched requests)
\r
690 "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3,
\r
697 // sample failure packet (one request)
\r
699 "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6",
\r
702 "email":"already taken"
\r
709 * Also see the discussion in {@link Ext.form.Action.DirectLoad}.
\r
711 Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, {
\r
712 constructor : function(form, opts) {
\r
713 Ext.form.Action.DirectSubmit.superclass.constructor.call(this, form, opts);
\r
715 type : 'directsubmit',
\r
716 // override of Submit
\r
718 var o = this.options;
\r
719 if(o.clientValidation === false || this.form.isValid()){
\r
720 // tag on any additional params to be posted in the
\r
722 this.success.params = this.getParams();
\r
723 this.form.api.submit(this.form.el.dom, this.success, this);
\r
724 }else if (o.clientValidation !== false){ // client validation failed
\r
725 this.failureType = Ext.form.Action.CLIENT_INVALID;
\r
726 this.form.afterAction(this, false);
\r
730 getParams : function() {
\r
732 var bp = this.form.baseParams;
\r
733 var p = this.options.params;
\r
734 Ext.apply(o, p, bp);
\r
737 // Direct actions have already been processed and therefore
\r
738 // we can directly set the result; Direct Actions do not have
\r
739 // a this.response property.
\r
740 processResponse : function(result) {
\r
741 this.result = result;
\r
745 success : function(response, trans){
\r
746 if(trans.type == Ext.Direct.exceptions.SERVER){
\r
749 Ext.form.Action.DirectSubmit.superclass.success.call(this, response);
\r
753 Ext.form.Action.ACTION_TYPES = {
\r
754 'load' : Ext.form.Action.Load,
\r
755 'submit' : Ext.form.Action.Submit,
\r
756 'directload' : Ext.form.Action.DirectLoad,
\r
757 'directsubmit' : Ext.form.Action.DirectSubmit
\r