Alien-Web-ExtJS-V3

 view release on metacpan or  search on metacpan

share/docs/source/BasicForm.html  view on Meta::CPAN

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='Ext-form-BasicForm-method-constructor'><span id='Ext-form-BasicForm'>/**
</span></span> * @class Ext.form.BasicForm
 * @extends Ext.util.Observable
 * &lt;p&gt;Encapsulates the DOM &amp;lt;form&gt; element at the heart of the {@link Ext.form.FormPanel FormPanel} class, and provides
 * input field management, validation, submission, and form loading services.&lt;/p&gt;
 * &lt;p&gt;By default, Ext Forms are submitted through Ajax, using an instance of {@link Ext.form.Action.Submit}.
 * To enable normal browser submission of an Ext Form, use the {@link #standardSubmit} config option.&lt;/p&gt;
 * &lt;p&gt;&lt;b&gt;&lt;u&gt;File Uploads&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;
 * &lt;p&gt;{@link #fileUpload File uploads} are not performed using Ajax submission, that
 * is they are &lt;b&gt;not&lt;/b&gt; performed using XMLHttpRequests. Instead the form is submitted in the standard
 * manner with the DOM &lt;tt&gt;&amp;lt;form&gt;&lt;/tt&gt; element temporarily modified to have its
 * &lt;a href=&quot;http://www.w3.org/TR/REC-html40/present/frames.html#adef-target&quot;&gt;target&lt;/a&gt; set to refer
 * to a dynamically generated, hidden &lt;tt&gt;&amp;lt;iframe&gt;&lt;/tt&gt; which is inserted into the document
 * but removed after the return data has been gathered.&lt;/p&gt;
 * &lt;p&gt;The server response is parsed by the browser to create the document for the IFRAME. If the
 * server is using JSON to send the return object, then the
 * &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17&quot;&gt;Content-Type&lt;/a&gt; header
 * must be set to &quot;text/html&quot; in order to tell the browser to insert the text unchanged into the document body.&lt;/p&gt;
 * &lt;p&gt;Characters which are significant to an HTML parser must be sent as HTML entities, so encode
 * &quot;&amp;lt;&quot; as &quot;&amp;amp;lt;&quot;, &quot;&amp;amp;&quot; as &quot;&amp;amp;amp;&quot; etc.&lt;/p&gt;
 * &lt;p&gt;The response text is retrieved from the document, and a fake XMLHttpRequest object
 * is created containing a &lt;tt&gt;responseText&lt;/tt&gt; property in order to conform to the
 * requirements of event handlers and callbacks.&lt;/p&gt;
 * &lt;p&gt;Be aware that file upload packets are sent with the content type &lt;a href=&quot;http://www.faqs.org/rfcs/rfc2388.html&quot;&gt;multipart/form&lt;/a&gt;
 * and some server technologies (notably JEE) may require some custom processing in order to
 * retrieve parameter names and parameter values from the packet content.&lt;/p&gt;
 * @constructor
 * @param {Mixed} el The form element or its id
 * @param {Object} config Configuration options
 */
Ext.form.BasicForm = Ext.extend(Ext.util.Observable, {

    constructor: function(el, config){
        Ext.apply(this, config);
        if(Ext.isString(this.paramOrder)){
            this.paramOrder = this.paramOrder.split(/[\s,|]/);
        }
<span id='Ext-form-BasicForm-property-items'>        /**
</span>         * A {@link Ext.util.MixedCollection MixedCollection} containing all the Ext.form.Fields in this form.
         * @type MixedCollection
         * @property items
         */
        this.items = new Ext.util.MixedCollection(false, function(o){
            return o.getItemId();
        });
        this.addEvents(
<span id='Ext-form-BasicForm-event-beforeaction'>            /**
</span>             * @event beforeaction
             * Fires before any action is performed. Return false to cancel the action.
             * @param {Form} this
             * @param {Action} action The {@link Ext.form.Action} to be performed
             */
            'beforeaction',
<span id='Ext-form-BasicForm-event-actionfailed'>            /**
</span>             * @event actionfailed
             * Fires when an action fails.
             * @param {Form} this
             * @param {Action} action The {@link Ext.form.Action} that failed
             */
            'actionfailed',
<span id='Ext-form-BasicForm-event-actioncomplete'>            /**
</span>             * @event actioncomplete
             * Fires when an action is completed.
             * @param {Form} this
             * @param {Action} action The {@link Ext.form.Action} that completed
             */
            'actioncomplete'
        );

        if(el){
            this.initEl(el);
        }
        Ext.form.BasicForm.superclass.constructor.call(this);
    },

<span id='Ext-form-BasicForm-cfg-method'>    /**
</span>     * @cfg {String} method
     * The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
     */
<span id='Ext-form-BasicForm-cfg-reader'>    /**
</span>     * @cfg {DataReader} reader
     * An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to read
     * data when executing 'load' actions. This is optional as there is built-in
     * support for processing JSON.  For additional information on using an XMLReader
     * see the example provided in examples/form/xml-form.html.
     */
<span id='Ext-form-BasicForm-cfg-errorReader'>    /**
</span>     * @cfg {DataReader} errorReader
     * &lt;p&gt;An Ext.data.DataReader (e.g. {@link Ext.data.XmlReader}) to be used to
     * read field error messages returned from 'submit' actions. This is optional
     * as there is built-in support for processing JSON.&lt;/p&gt;
     * &lt;p&gt;The Records which provide messages for the invalid Fields must use the
     * Field name (or id) as the Record ID, and must contain a field called 'msg'
     * which contains the error message.&lt;/p&gt;
     * &lt;p&gt;The errorReader does not have to be a full-blown implementation of a
     * DataReader. It simply needs to implement a &lt;tt&gt;read(xhr)&lt;/tt&gt; function
     * which returns an Array of Records in an object with the following
     * structure:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
{
    records: recordArray
}
&lt;/code&gt;&lt;/pre&gt;
     */
<span id='Ext-form-BasicForm-cfg-url'>    /**
</span>     * @cfg {String} url
     * The URL to use for form actions if one isn't supplied in the
     * &lt;code&gt;{@link #doAction doAction} options&lt;/code&gt;.
     */
<span id='Ext-form-BasicForm-cfg-fileUpload'>    /**
</span>     * @cfg {Boolean} fileUpload
     * Set to true if this form is a file upload.
     * &lt;p&gt;File uploads are not performed using normal 'Ajax' techniques, that is they are &lt;b&gt;not&lt;/b&gt;
     * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
     * DOM &lt;tt&gt;&amp;lt;form&gt;&lt;/tt&gt; element temporarily modified to have its
     * &lt;a href=&quot;http://www.w3.org/TR/REC-html40/present/frames.html#adef-target&quot;&gt;target&lt;/a&gt; set to refer
     * to a dynamically generated, hidden &lt;tt&gt;&amp;lt;iframe&gt;&lt;/tt&gt; which is inserted into the document
     * but removed after the return data has been gathered.&lt;/p&gt;
     * &lt;p&gt;The server response is parsed by the browser to create the document for the IFRAME. If the
     * server is using JSON to send the return object, then the
     * &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17&quot;&gt;Content-Type&lt;/a&gt; header
     * must be set to &quot;text/html&quot; in order to tell the browser to insert the text unchanged into the document body.&lt;/p&gt;
     * &lt;p&gt;Characters which are significant to an HTML parser must be sent as HTML entities, so encode
     * &quot;&amp;lt;&quot; as &quot;&amp;amp;lt;&quot;, &quot;&amp;amp;&quot; as &quot;&amp;amp;amp;&quot; etc.&lt;/p&gt;
     * &lt;p&gt;The response text is retrieved from the document, and a fake XMLHttpRequest object
     * is created containing a &lt;tt&gt;responseText&lt;/tt&gt; property in order to conform to the
     * requirements of event handlers and callbacks.&lt;/p&gt;
     * &lt;p&gt;Be aware that file upload packets are sent with the content type &lt;a href=&quot;http://www.faqs.org/rfcs/rfc2388.html&quot;&gt;multipart/form&lt;/a&gt;
     * and some server technologies (notably JEE) may require some custom processing in order to
     * retrieve parameter names and parameter values from the packet content.&lt;/p&gt;
     */
<span id='Ext-form-BasicForm-cfg-baseParams'>    /**
</span>     * @cfg {Object} baseParams
     * &lt;p&gt;Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.&lt;/p&gt;
     * &lt;p&gt;Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.&lt;/p&gt;
     */
<span id='Ext-form-BasicForm-cfg-timeout'>    /**
</span>     * @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
     */
    timeout: 30,

<span id='Ext-form-BasicForm-cfg-api'>    /**
</span>     * @cfg {Object} api (Optional) If specified load and submit actions will be handled
     * with {@link Ext.form.Action.DirectLoad} and {@link Ext.form.Action.DirectSubmit}.
     * Methods which have been imported by Ext.Direct can be specified here to load and submit
     * forms.
     * Such as the following:&lt;pre&gt;&lt;code&gt;
api: {
    load: App.ss.MyProfile.load,
    submit: App.ss.MyProfile.submit
}
&lt;/code&gt;&lt;/pre&gt;
     * &lt;p&gt;Load actions can use &lt;code&gt;{@link #paramOrder}&lt;/code&gt; or &lt;code&gt;{@link #paramsAsHash}&lt;/code&gt;
     * to customize how the load method is invoked.
     * Submit actions will always use a standard form submit. The formHandler configuration must
     * be set on the associated server-side method which has been imported by Ext.Direct&lt;/p&gt;
     */

<span id='Ext-form-BasicForm-cfg-paramOrder'>    /**
</span>     * @cfg {Array/String} paramOrder &lt;p&gt;A list of params to be executed server side.
     * Defaults to &lt;tt&gt;undefined&lt;/tt&gt;. Only used for the &lt;code&gt;{@link #api}&lt;/code&gt;
     * &lt;code&gt;load&lt;/code&gt; configuration.&lt;/p&gt;
     * &lt;br&gt;&lt;p&gt;Specify the params in the order in which they must be executed on the
     * server-side as either (1) an Array of String values, or (2) a String of params
     * delimited by either whitespace, comma, or pipe. For example,
     * any of the following would be acceptable:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
paramOrder: ['param1','param2','param3']
paramOrder: 'param1 param2 param3'
paramOrder: 'param1,param2,param3'
paramOrder: 'param1|param2|param'
     &lt;/code&gt;&lt;/pre&gt;
     */
    paramOrder: undefined,

<span id='Ext-form-BasicForm-cfg-paramsAsHash'>    /**
</span>     * @cfg {Boolean} paramsAsHash Only used for the &lt;code&gt;{@link #api}&lt;/code&gt;
     * &lt;code&gt;load&lt;/code&gt; configuration. Send parameters as a collection of named
     * arguments (defaults to &lt;tt&gt;false&lt;/tt&gt;). Providing a
     * &lt;tt&gt;{@link #paramOrder}&lt;/tt&gt; nullifies this configuration.
     */
    paramsAsHash: false,

<span id='Ext-form-BasicForm-cfg-waitTitle'>    /**
</span>     * @cfg {String} waitTitle
     * The default title to show for the waiting message box (defaults to &lt;tt&gt;'Please Wait...'&lt;/tt&gt;)
     */
    waitTitle: 'Please Wait...',



( run in 0.995 second using v1.01-cache-2.11-cpan-62a16548d74 )