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.BasicForm"></div>/**
15 * @class Ext.form.BasicForm
16 * @extends Ext.util.Observable
17 * <p>Encapsulates the DOM <form> element at the heart of the {@link Ext.form.FormPanel FormPanel} class, and provides
18 * input field management, validation, submission, and form loading services.</p>
19 * <p>By default, Ext Forms are submitted through Ajax, using an instance of {@link Ext.form.Action.Submit}.
20 * To enable normal browser submission of an Ext Form, use the {@link #standardSubmit} config option.</p>
21 * <p><b><u>File Uploads</u></b></p>
22 * <p>{@link #fileUpload File uploads} are not performed using Ajax submission, that
23 * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
24 * manner with the DOM <tt><form></tt> element temporarily modified to have its
25 * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
26 * to a dynamically generated, hidden <tt><iframe></tt> which is inserted into the document
27 * but removed after the return data has been gathered.</p>
28 * <p>The server response is parsed by the browser to create the document for the IFRAME. If the
29 * server is using JSON to send the return object, then the
30 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
31 * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
32 * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
33 * "<" as "&lt;", "&" as "&amp;" etc.</p>
34 * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
35 * is created containing a <tt>responseText</tt> property in order to conform to the
36 * requirements of event handlers and callbacks.</p>
37 * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
38 * and some server technologies (notably JEE) may require some custom processing in order to
39 * retrieve parameter names and parameter values from the packet content.</p>
41 * @param {Mixed} el The form element or its id
42 * @param {Object} config Configuration options
44 Ext.form.BasicForm = function(el, config){
45 Ext.apply(this, config);
46 if(Ext.isString(this.paramOrder)){
47 this.paramOrder = this.paramOrder.split(/[\s,|]/);
49 <div id="prop-Ext.form.BasicForm-items"></div>/**
51 * A {@link Ext.util.MixedCollection MixedCollection) containing all the Ext.form.Fields in this form.
52 * @type MixedCollection
54 this.items = new Ext.util.MixedCollection(false, function(o){
58 <div id="event-Ext.form.BasicForm-beforeaction"></div>/**
60 * Fires before any action is performed. Return false to cancel the action.
62 * @param {Action} action The {@link Ext.form.Action} to be performed
65 <div id="event-Ext.form.BasicForm-actionfailed"></div>/**
67 * Fires when an action fails.
69 * @param {Action} action The {@link Ext.form.Action} that failed
72 <div id="event-Ext.form.BasicForm-actioncomplete"></div>/**
73 * @event actioncomplete
74 * Fires when an action is completed.
76 * @param {Action} action The {@link Ext.form.Action} that completed
84 Ext.form.BasicForm.superclass.constructor.call(this);
87 Ext.extend(Ext.form.BasicForm, Ext.util.Observable, {
88 <div id="cfg-Ext.form.BasicForm-method"></div>/**
89 * @cfg {String} method
90 * The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
92 <div id="cfg-Ext.form.BasicForm-reader"></div>/**
93 * @cfg {DataReader} reader
94 * An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to read
95 * data when executing 'load' actions. This is optional as there is built-in
96 * support for processing JSON. For additional information on using an XMLReader
97 * see the example provided in examples/form/xml-form.html.
99 <div id="cfg-Ext.form.BasicForm-errorReader"></div>/**
100 * @cfg {DataReader} errorReader
101 * <p>An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to
102 * read field error messages returned from 'submit' actions. This is optional
103 * as there is built-in support for processing JSON.</p>
104 * <p>The Records which provide messages for the invalid Fields must use the
105 * Field name (or id) as the Record ID, and must contain a field called 'msg'
106 * which contains the error message.</p>
107 * <p>The errorReader does not have to be a full-blown implementation of a
108 * DataReader. It simply needs to implement a <tt>read(xhr)</tt> function
109 * which returns an Array of Records in an object with the following
110 * structure:</p><pre><code>
116 <div id="cfg-Ext.form.BasicForm-url"></div>/**
118 * The URL to use for form actions if one isn't supplied in the
119 * <code>{@link #doAction doAction} options</code>.
121 <div id="cfg-Ext.form.BasicForm-fileUpload"></div>/**
122 * @cfg {Boolean} fileUpload
123 * Set to true if this form is a file upload.
124 * <p>File uploads are not performed using normal 'Ajax' techniques, that is they are <b>not</b>
125 * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
126 * DOM <tt><form></tt> element temporarily modified to have its
127 * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
128 * to a dynamically generated, hidden <tt><iframe></tt> which is inserted into the document
129 * but removed after the return data has been gathered.</p>
130 * <p>The server response is parsed by the browser to create the document for the IFRAME. If the
131 * server is using JSON to send the return object, then the
132 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
133 * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
134 * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
135 * "<" as "&lt;", "&" as "&amp;" etc.</p>
136 * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
137 * is created containing a <tt>responseText</tt> property in order to conform to the
138 * requirements of event handlers and callbacks.</p>
139 * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
140 * and some server technologies (notably JEE) may require some custom processing in order to
141 * retrieve parameter names and parameter values from the packet content.</p>
143 <div id="cfg-Ext.form.BasicForm-baseParams"></div>/**
144 * @cfg {Object} baseParams
145 * <p>Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.</p>
146 * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p>
148 <div id="cfg-Ext.form.BasicForm-timeout"></div>/**
149 * @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
153 <div id="cfg-Ext.form.BasicForm-api"></div>/**
154 * @cfg {Object} api (Optional) If specified load and submit actions will be handled
155 * with {@link Ext.form.Action.DirectLoad} and {@link Ext.form.Action.DirectSubmit}.
156 * Methods which have been imported by Ext.Direct can be specified here to load and submit
158 * Such as the following:<pre><code>
160 load: App.ss.MyProfile.load,
161 submit: App.ss.MyProfile.submit
164 * <p>Load actions can use <code>{@link #paramOrder}</code> or <code>{@link #paramsAsHash}</code>
165 * to customize how the load method is invoked.
166 * Submit actions will always use a standard form submit. The formHandler configuration must
167 * be set on the associated server-side method which has been imported by Ext.Direct</p>
170 <div id="cfg-Ext.form.BasicForm-paramOrder"></div>/**
171 * @cfg {Array/String} paramOrder <p>A list of params to be executed server side.
172 * Defaults to <tt>undefined</tt>. Only used for the <code>{@link #api}</code>
173 * <code>load</code> configuration.</p>
174 * <br><p>Specify the params in the order in which they must be executed on the
175 * server-side as either (1) an Array of String values, or (2) a String of params
176 * delimited by either whitespace, comma, or pipe. For example,
177 * any of the following would be acceptable:</p><pre><code>
178 paramOrder: ['param1','param2','param3']
179 paramOrder: 'param1 param2 param3'
180 paramOrder: 'param1,param2,param3'
181 paramOrder: 'param1|param2|param'
184 paramOrder: undefined,
186 <div id="cfg-Ext.form.BasicForm-paramsAsHash"></div>/**
187 * @cfg {Boolean} paramsAsHash Only used for the <code>{@link #api}</code>
188 * <code>load</code> configuration. Send parameters as a collection of named
189 * arguments (defaults to <tt>false</tt>). Providing a
190 * <tt>{@link #paramOrder}</tt> nullifies this configuration.
194 <div id="cfg-Ext.form.BasicForm-waitTitle"></div>/**
195 * @cfg {String} waitTitle
196 * The default title to show for the waiting message box (defaults to <tt>'Please Wait...'</tt>)
198 waitTitle: 'Please Wait...',
203 <div id="cfg-Ext.form.BasicForm-trackResetOnLoad"></div>/**
204 * @cfg {Boolean} trackResetOnLoad If set to <tt>true</tt>, {@link #reset}() resets to the last loaded
205 * or {@link #setValues}() data instead of when the form was first created. Defaults to <tt>false</tt>.
207 trackResetOnLoad : false,
209 <div id="cfg-Ext.form.BasicForm-standardSubmit"></div>/**
210 * @cfg {Boolean} standardSubmit
211 * <p>If set to <tt>true</tt>, standard HTML form submits are used instead
212 * of XHR (Ajax) style form submissions. Defaults to <tt>false</tt>.</p>
213 * <br><p><b>Note:</b> When using <code>standardSubmit</code>, the
214 * <code>options</code> to <code>{@link #submit}</code> are ignored because
215 * Ext's Ajax infrastracture is bypassed. To pass extra parameters (e.g.
216 * <code>baseParams</code> and <code>params</code>), utilize hidden fields
217 * to submit extra data, for example:</p>
220 standardSubmit: true,
224 {@link url}: 'myProcess.php',
232 var fp = this.ownerCt.ownerCt,
234 if (form.isValid()) {
235 // check if there are baseParams and if
236 // hiddent items have been added already
237 if (fp.baseParams && !fp.paramsAdded) {
238 // add hidden items for all baseParams
239 for (i in fp.baseParams) {
243 value: fp.baseParams[i]
247 // set a custom flag to prevent re-adding
248 fp.paramsAdded = true;
250 form.{@link #submit}();
257 <div id="prop-Ext.form.BasicForm-waitMsgTarget"></div>/**
258 * By default wait messages are displayed with Ext.MessageBox.wait. You can target a specific
259 * element by passing it or its id or mask the form itself by passing in true.
261 * @property waitMsgTarget
265 initEl : function(el){
266 this.el = Ext.get(el);
267 this.id = this.el.id || Ext.id();
268 if(!this.standardSubmit){
269 this.el.on('submit', this.onSubmit, this);
271 this.el.addClass('x-form');
274 <div id="method-Ext.form.BasicForm-getEl"></div>/**
275 * Get the HTML form Element
276 * @return Ext.Element
283 onSubmit : function(e){
288 destroy: function() {
289 this.items.each(function(f){
293 this.el.removeAllListeners();
296 this.purgeListeners();
299 <div id="method-Ext.form.BasicForm-isValid"></div>/**
300 * Returns true if client-side validation on the form is successful.
303 isValid : function(){
305 this.items.each(function(f){
313 <div id="method-Ext.form.BasicForm-isDirty"></div>/**
314 * <p>Returns true if any fields in this form have changed from their original values.</p>
315 * <p>Note that if this BasicForm was configured with {@link #trackResetOnLoad} then the
316 * Fields' <i>original values</i> are updated when the values are loaded by {@link #setValues}
317 * or {@link #loadRecord}.</p>
320 isDirty : function(){
322 this.items.each(function(f){
331 <div id="method-Ext.form.BasicForm-doAction"></div>/**
332 * Performs a predefined action ({@link Ext.form.Action.Submit} or
333 * {@link Ext.form.Action.Load}) or a custom extension of {@link Ext.form.Action}
334 * to perform application-specific processing.
335 * @param {String/Object} actionName The name of the predefined action type,
336 * or instance of {@link Ext.form.Action} to perform.
337 * @param {Object} options (optional) The options to pass to the {@link Ext.form.Action}.
338 * All of the config options listed below are supported by both the
339 * {@link Ext.form.Action.Submit submit} and {@link Ext.form.Action.Load load}
340 * actions unless otherwise noted (custom actions could also accept
341 * other config options):<ul>
343 * <li><b>url</b> : String<div class="sub-desc">The url for the action (defaults
344 * to the form's {@link #url}.)</div></li>
346 * <li><b>method</b> : String<div class="sub-desc">The form method to use (defaults
347 * to the form's method, or POST if not defined)</div></li>
349 * <li><b>params</b> : String/Object<div class="sub-desc"><p>The params to pass
350 * (defaults to the form's baseParams, or none if not defined)</p>
351 * <p>Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.</p></div></li>
353 * <li><b>headers</b> : Object<div class="sub-desc">Request headers to set for the action
354 * (defaults to the form's default headers)</div></li>
356 * <li><b>success</b> : Function<div class="sub-desc">The callback that will
357 * be invoked after a successful response (see top of
358 * {@link Ext.form.Action.Submit submit} and {@link Ext.form.Action.Load load}
359 * for a description of what constitutes a successful response).
360 * The function is passed the following parameters:<ul>
361 * <li><tt>form</tt> : Ext.form.BasicForm<div class="sub-desc">The form that requested the action</div></li>
362 * <li><tt>action</tt> : The {@link Ext.form.Action Action} object which performed the operation.
363 * <div class="sub-desc">The action object contains these properties of interest:<ul>
364 * <li><tt>{@link Ext.form.Action#response response}</tt></li>
365 * <li><tt>{@link Ext.form.Action#result result}</tt> : interrogate for custom postprocessing</li>
366 * <li><tt>{@link Ext.form.Action#type type}</tt></li>
367 * </ul></div></li></ul></div></li>
369 * <li><b>failure</b> : Function<div class="sub-desc">The callback that will be invoked after a
370 * failed transaction attempt. The function is passed the following parameters:<ul>
371 * <li><tt>form</tt> : The {@link Ext.form.BasicForm} that requested the action.</li>
372 * <li><tt>action</tt> : The {@link Ext.form.Action Action} object which performed the operation.
373 * <div class="sub-desc">The action object contains these properties of interest:<ul>
374 * <li><tt>{@link Ext.form.Action#failureType failureType}</tt></li>
375 * <li><tt>{@link Ext.form.Action#response response}</tt></li>
376 * <li><tt>{@link Ext.form.Action#result result}</tt> : interrogate for custom postprocessing</li>
377 * <li><tt>{@link Ext.form.Action#type type}</tt></li>
378 * </ul></div></li></ul></div></li>
380 * <li><b>scope</b> : Object<div class="sub-desc">The scope in which to call the
381 * callback functions (The <tt>this</tt> reference for the callback functions).</div></li>
383 * <li><b>clientValidation</b> : Boolean<div class="sub-desc">Submit Action only.
384 * Determines whether a Form's fields are validated in a final call to
385 * {@link Ext.form.BasicForm#isValid isValid} prior to submission. Set to <tt>false</tt>
386 * to prevent this. If undefined, pre-submission field validation is performed.</div></li></ul>
388 * @return {BasicForm} this
390 doAction : function(action, options){
391 if(Ext.isString(action)){
392 action = new Ext.form.Action.ACTION_TYPES[action](this, options);
394 if(this.fireEvent('beforeaction', this, action) !== false){
395 this.beforeAction(action);
396 action.run.defer(100, action);
401 <div id="method-Ext.form.BasicForm-submit"></div>/**
402 * Shortcut to {@link #doAction do} a {@link Ext.form.Action.Submit submit action}.
403 * @param {Object} options The options to pass to the action (see {@link #doAction} for details).<br>
404 * <p><b>Note:</b> this is ignored when using the {@link #standardSubmit} option.</p>
405 * <p>The following code:</p><pre><code>
406 myFormPanel.getForm().submit({
407 clientValidation: true,
408 url: 'updateConsignment.php',
410 newStatus: 'delivered'
412 success: function(form, action) {
413 Ext.Msg.alert('Success', action.result.msg);
415 failure: function(form, action) {
416 switch (action.failureType) {
417 case Ext.form.Action.CLIENT_INVALID:
418 Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
420 case Ext.form.Action.CONNECT_FAILURE:
421 Ext.Msg.alert('Failure', 'Ajax communication failed');
423 case Ext.form.Action.SERVER_INVALID:
424 Ext.Msg.alert('Failure', action.result.msg);
429 * would process the following server response for a successful submission:<pre><code>
431 "success":true, // note this is Boolean, not string
432 "msg":"Consignment updated"
435 * and the following server response for a failed submission:<pre><code>
437 "success":false, // note this is Boolean, not string
438 "msg":"You do not have permission to perform this operation"
441 * @return {BasicForm} this
443 submit : function(options){
444 if(this.standardSubmit){
445 var v = this.isValid();
447 var el = this.el.dom;
448 if(this.url && Ext.isEmpty(el.action)){
449 el.action = this.url;
455 var submitAction = String.format('{0}submit', this.api ? 'direct' : '');
456 this.doAction(submitAction, options);
460 <div id="method-Ext.form.BasicForm-load"></div>/**
461 * Shortcut to {@link #doAction do} a {@link Ext.form.Action.Load load action}.
462 * @param {Object} options The options to pass to the action (see {@link #doAction} for details)
463 * @return {BasicForm} this
465 load : function(options){
466 var loadAction = String.format('{0}load', this.api ? 'direct' : '');
467 this.doAction(loadAction, options);
471 <div id="method-Ext.form.BasicForm-updateRecord"></div>/**
472 * Persists the values in this form into the passed {@link Ext.data.Record} object in a beginEdit/endEdit block.
473 * @param {Record} record The record to edit
474 * @return {BasicForm} this
476 updateRecord : function(record){
478 var fs = record.fields;
480 var field = this.findField(f.name);
482 record.set(f.name, field.getValue());
489 <div id="method-Ext.form.BasicForm-loadRecord"></div>/**
490 * Loads an {@link Ext.data.Record} into this form by calling {@link #setValues} with the
491 * {@link Ext.data.Record#data record data}.
492 * See also {@link #trackResetOnLoad}.
493 * @param {Record} record The record to load
494 * @return {BasicForm} this
496 loadRecord : function(record){
497 this.setValues(record.data);
502 beforeAction : function(action){
503 var o = action.options;
505 if(this.waitMsgTarget === true){
506 this.el.mask(o.waitMsg, 'x-mask-loading');
507 }else if(this.waitMsgTarget){
508 this.waitMsgTarget = Ext.get(this.waitMsgTarget);
509 this.waitMsgTarget.mask(o.waitMsg, 'x-mask-loading');
511 Ext.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle);
517 afterAction : function(action, success){
518 this.activeAction = null;
519 var o = action.options;
521 if(this.waitMsgTarget === true){
523 }else if(this.waitMsgTarget){
524 this.waitMsgTarget.unmask();
526 Ext.MessageBox.updateProgress(1);
527 Ext.MessageBox.hide();
534 Ext.callback(o.success, o.scope, [this, action]);
535 this.fireEvent('actioncomplete', this, action);
537 Ext.callback(o.failure, o.scope, [this, action]);
538 this.fireEvent('actionfailed', this, action);
542 <div id="method-Ext.form.BasicForm-findField"></div>/**
543 * Find a {@link Ext.form.Field} in this form.
544 * @param {String} id The value to search for (specify either a {@link Ext.Component#id id},
545 * {@link Ext.grid.Column#dataIndex dataIndex}, {@link Ext.form.Field#getName name or hiddenName}).
548 findField : function(id){
549 var field = this.items.get(id);
550 if(!Ext.isObject(field)){
551 this.items.each(function(f){
552 if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){
558 return field || null;
562 <div id="method-Ext.form.BasicForm-markInvalid"></div>/**
563 * Mark fields in this form invalid in bulk.
564 * @param {Array/Object} errors Either an array in the form [{id:'fieldId', msg:'The message'},...] or an object hash of {id: msg, id2: msg2}
565 * @return {BasicForm} this
567 markInvalid : function(errors){
568 if(Ext.isArray(errors)){
569 for(var i = 0, len = errors.length; i < len; i++){
570 var fieldError = errors[i];
571 var f = this.findField(fieldError.id);
573 f.markInvalid(fieldError.msg);
579 if(!Ext.isFunction(errors[id]) && (field = this.findField(id))){
580 field.markInvalid(errors[id]);
587 <div id="method-Ext.form.BasicForm-setValues"></div>/**
588 * Set values for fields in this form in bulk.
589 * @param {Array/Object} values Either an array in the form:<pre><code>
590 [{id:'clientName', value:'Fred. Olsen Lines'},
591 {id:'portOfLoading', value:'FXT'},
592 {id:'portOfDischarge', value:'OSL'} ]</code></pre>
593 * or an object hash of the form:<pre><code>
595 clientName: 'Fred. Olsen Lines',
596 portOfLoading: 'FXT',
597 portOfDischarge: 'OSL'
599 * @return {BasicForm} this
601 setValues : function(values){
602 if(Ext.isArray(values)){ // array of objects
603 for(var i = 0, len = values.length; i < len; i++){
605 var f = this.findField(v.id);
608 if(this.trackResetOnLoad){
609 f.originalValue = f.getValue();
613 }else{ // object hash
616 if(!Ext.isFunction(values[id]) && (field = this.findField(id))){
617 field.setValue(values[id]);
618 if(this.trackResetOnLoad){
619 field.originalValue = field.getValue();
627 <div id="method-Ext.form.BasicForm-getValues"></div>/**
628 * <p>Returns the fields in this form as an object with key/value pairs as they would be submitted using a standard form submit.
629 * If multiple fields exist with the same name they are returned as an array.</p>
630 * <p><b>Note:</b> The values are collected from all enabled HTML input elements within the form, <u>not</u> from
631 * the Ext Field objects. This means that all returned values are Strings (or Arrays of Strings) and that the
632 * value can potentially be the emptyText of a field.</p>
633 * @param {Boolean} asString (optional) Pass true to return the values as a string. (defaults to false, returning an Object)
634 * @return {String/Object}
636 getValues : function(asString){
637 var fs = Ext.lib.Ajax.serializeForm(this.el.dom);
638 if(asString === true){
641 return Ext.urlDecode(fs);
644 getFieldValues : function(){
646 this.items.each(function(f){
647 o[f.getName()] = f.getValue();
652 <div id="method-Ext.form.BasicForm-clearInvalid"></div>/**
653 * Clears all invalid messages in this form.
654 * @return {BasicForm} this
656 clearInvalid : function(){
657 this.items.each(function(f){
663 <div id="method-Ext.form.BasicForm-reset"></div>/**
665 * @return {BasicForm} this
668 this.items.each(function(f){
674 <div id="method-Ext.form.BasicForm-add"></div>/**
675 * Add Ext.form Components to this form's Collection. This does not result in rendering of
676 * the passed Component, it just enables the form to validate Fields, and distribute values to
678 * <p><b>You will not usually call this function. In order to be rendered, a Field must be added
679 * to a {@link Ext.Container Container}, usually an {@link Ext.form.FormPanel FormPanel}.
680 * The FormPanel to which the field is added takes care of adding the Field to the BasicForm's
681 * collection.</b></p>
682 * @param {Field} field1
683 * @param {Field} field2 (optional)
684 * @param {Field} etc (optional)
685 * @return {BasicForm} this
688 this.items.addAll(Array.prototype.slice.call(arguments, 0));
693 <div id="method-Ext.form.BasicForm-remove"></div>/**
694 * Removes a field from the items collection (does NOT remove its markup).
695 * @param {Field} field
696 * @return {BasicForm} this
698 remove : function(field){
699 this.items.remove(field);
703 <div id="method-Ext.form.BasicForm-render"></div>/**
704 * Iterates through the {@link Ext.form.Field Field}s which have been {@link #add add}ed to this BasicForm,
705 * checks them for an id attribute, and calls {@link Ext.form.Field#applyToMarkup} on the existing dom element with that id.
706 * @return {BasicForm} this
709 this.items.each(function(f){
710 if(f.isFormField && !f.rendered && document.getElementById(f.id)){ // if the element exists
711 f.applyToMarkup(f.id);
717 <div id="method-Ext.form.BasicForm-applyToFields"></div>/**
718 * Calls {@link Ext#apply} for all fields in this form with the passed object.
719 * @param {Object} values
720 * @return {BasicForm} this
722 applyToFields : function(o){
723 this.items.each(function(f){
729 <div id="method-Ext.form.BasicForm-applyIfToFields"></div>/**
730 * Calls {@link Ext#applyIf} for all field in this form with the passed object.
731 * @param {Object} values
732 * @return {BasicForm} this
734 applyIfToFields : function(o){
735 this.items.each(function(f){
741 callFieldMethod : function(fnName, args){
743 this.items.each(function(f){
744 if(Ext.isFunction(f[fnName])){
745 f[fnName].apply(f, args);
753 Ext.BasicForm = Ext.form.BasicForm;</pre>