Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="exml:ext.form.action" xmlns:efa="exml:ext.form.action" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:exml="http://www.jangaroo.net/exml/0.8" xmlns:ef="exml:ext.form" >
  <xs:import namespace="http://www.jangaroo.net/exml/0.8"/>
  <xs:import namespace="exml:ext.form"/>
  <xs:complexType name='DirectLoad_TYPE'>
    <xs:complexContent>
      <xs:extension base='efa:Load_TYPE'>
        <xs:sequence>
        </xs:sequence>
        <xs:anyAttribute namespace="http://www.jangaroo.net/exml/0.8 exml:untyped" processContents="skip"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name='DirectLoad' type='efa:DirectLoad_TYPE' substitutionGroup='efa:Load'>
    <xs:annotation>
      <xs:documentation>
        Provides Ext.direct support for loading form data. <p>This example illustrates usage of Ext.Direct to <b>load</b> a form through Ext.Direct.</p><pre><code>var myFormPanel = new Ext.form.FormPanel({ // configs for FormPanel title: 'Basic Information', renderTo: document.body, width: 300, height: 160, padding: 10, // configs apply to child items defaults: {anchor: '100%'}, defaultType: 'textfield', items: [{ fieldLabel: 'Name', name: 'name' },{ fieldLabel: 'Email', name: 'email' },{ fieldLabel: 'Company', name: 'company' }], // configs for BasicForm api: { // The server-side method to call for load() requests load: Profile.getBasicInfo, // The server-side must mark the submit handler as a 'formHandler' submit: Profile.updateBasicInfo }, // specify the order for the passed params paramOrder: ['uid', 'foo'] }); // load the form myFormPanel.getForm().load({ // pass 2 arguments to server side getBasicInfo method (len=2) params: { foo: 'bar', uid: 34 } }); </code></pre>The data packet sent to the server will resemble something like: <pre><code>[ { "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2, "data":[34,"bar"] // note the order of the params } ] </code></pre>The form will process a data packet returned by the server that is similar to the following format: <pre><code>[ { "action":"Profile","method":"getBasicInfo","type":"rpc","tid":2, "result":{ "success":true, "data":{ "name":"Fred Flintstone", "company":"Slate Rock and Gravel", "email":"fred.flintstone&#64;slaterg.com" } } } ] </code></pre> <p>This class serves as a typed config object for constructor of class DirectLoad.</p> <p>Copyright &#169; 2011 Sencha Inc.</p> @see ext.form.action.DirectLoad
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name='DirectSubmit_TYPE'>
    <xs:complexContent>
      <xs:extension base='efa:Submit_TYPE'>
        <xs:sequence>
        </xs:sequence>
        <xs:anyAttribute namespace="http://www.jangaroo.net/exml/0.8 exml:untyped" processContents="skip"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name='DirectSubmit' type='efa:DirectSubmit_TYPE' substitutionGroup='efa:Submit'>
    <xs:annotation>
      <xs:documentation>
        Provides Ext.direct support for submitting form data. <p>This example illustrates usage of Ext.Direct to <b>submit</b> a form through Ext.Direct.</p><pre><code>var myFormPanel = new Ext.form.FormPanel({ // configs for FormPanel title: 'Basic Information', renderTo: document.body, width: 300, height: 160, padding: 10, buttons:[{ text: 'Submit', handler: function(){ myFormPanel.getForm().submit({ params: { foo: 'bar', uid: 34 } }); } }], // configs apply to child items defaults: {anchor: '100%'}, defaultType: 'textfield', items: [{ fieldLabel: 'Name', name: 'name' },{ fieldLabel: 'Email', name: 'email' },{ fieldLabel: 'Company', name: 'company' }], // configs for BasicForm api: { // The server-side method to call for load() requests load: Profile.getBasicInfo, // The server-side must mark the submit handler as a 'formHandler' submit: Profile.updateBasicInfo }, // specify the order for the passed params paramOrder: ['uid', 'foo'] }); </code></pre>The data packet sent to the server will resemble something like: <pre><code>{ "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6", "result":{ "success":true, "id":{ "extAction":"Profile","extMethod":"updateBasicInfo", "extType":"rpc","extTID":"6","extUpload":"false", "name":"Aaron Conran","email":"aaron&#64;extjs.com","company":"Ext JS, LLC" } } } </code></pre>The form will process a data packet returned by the server that is similar to the following: <pre><code>// sample success packet (batched requests) [ { "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":3, "result":{ "success":true } } ] // sample failure packet (one request) { "action":"Profile","method":"updateBasicInfo","type":"rpc","tid":"6", "result":{ "errors":{ "email":"already taken" }, "success":false, "foo":"bar" } } </code></pre>Also see the discussion in <a href="Ext.form.Action.DirectLoad.html">Ext.form.Action.DirectLoad</a>. <p>This class serves as a typed config object for constructor of class DirectSubmit.</p> <p>Copyright &#169; 2011 Sencha Inc.</p> @see ext.form.action.DirectSubmit
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name='Load_TYPE'>
    <xs:complexContent>
      <xs:extension base='ef:Action_TYPE'>
        <xs:sequence>
        </xs:sequence>
        <xs:anyAttribute namespace="http://www.jangaroo.net/exml/0.8 exml:untyped" processContents="skip"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name='Load' type='efa:Load_TYPE' substitutionGroup='ef:Action'>
    <xs:annotation>
      <xs:documentation>
        A class which handles loading of data from a server into the Fields of an <a href="Ext.form.BasicForm.html">Ext.form.BasicForm</a>. <p>Instances of this class are only created by a <a href="Ext.form.BasicForm.html">Form</a> when <a href="output/Ext.form.BasicForm.html#Ext.form.BasicForm-load">load</a>ing.</p><p><u><b>Response Packet Criteria</b></u></p><p>A response packet <b>must</b> contain:</p><div class="mdetail-params"><ul><li><b><code>success</code></b> property : Boolean</li><li><b><code>data</code></b> property : Object</li><li style="list-style: none"><div class="sub-desc">The <code>data</code> property contains the values of Fields to load. The individual value object for each Field is passed to the Field's <a href="output/Ext.form.Field.html#Ext.form.Field-setValue">setValue</a> method.</div></li></ul></div><p><u><b>JSON Packets</b></u></p><p>By default, response packets are assumed to be JSON, so for the following form load call:</p><pre><code>var myFormPanel = new Ext.form.FormPanel({ title: 'Client and routing info', items: [{ fieldLabel: 'Client', name: 'clientName' }, { fieldLabel: 'Port of loading', name: 'portOfLoading' }, { fieldLabel: 'Port of discharge', name: 'portOfDischarge' }] }); myFormPanel.<a href="output/Ext.form.FormPanel.html#Ext.form.FormPanel-getForm">getForm</a>().<a href="output/Ext.form.BasicForm.html#Ext.form.BasicForm-load">load</a>({ url: '/getRoutingInfo.php', params: { consignmentRef: myConsignmentRef }, failure: function(form, action) { Ext.Msg.alert("Load failed", action.result.errorMessage); } }); </code></pre>a <b>success response</b> packet may look like this:<br/><br/><pre><code>{ success: true, data: { clientName: "Fred. Olsen Lines", portOfLoading: "FXT", portOfDischarge: "OSL" } }</code></pre>while a <b>failure response</b> packet may look like this:<br/><br/><pre><code>{ success: false, errorMessage: "Consignment reference not found" }</code></pre><p>Other data may be placed into the response for processing the <a href="Ext.form.BasicForm.html">Form</a>'s callback or event handler methods. The object decoded from this JSON is available in the <a href="output/Ext.form.Action.html#Ext.form.Action-result">result</a> property.</p> <p>This class serves as a typed config object for constructor of class Load.</p> <p>Copyright &#169; 2011 Sencha Inc.</p> @see ext.form.action.Load
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name='Submit_TYPE'>
    <xs:complexContent>
      <xs:extension base='ef:Action_TYPE'>
        <xs:sequence>
            <xs:element name='errorReader' minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:documentation>
                  Optional. JSON is interpreted with no need for an errorReader. <p>A Reader which reads a single record from the returned data. The DataReader's <b>success</b> property specifies how submission success is determined. The Record's data provides the error messages to apply to any invalid form Fields.</p>
                </xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence>
                  <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute type='exml:Boolean' name='clientValidation'>
          <xs:annotation>
            <xs:documentation>
              Determines whether a Form's fields are validated in a final call to <a href="output/Ext.form.BasicForm.html#Ext.form.BasicForm-isValid">isValid</a> prior to submission. Pass <tt>false</tt> in the Form's submit options to prevent this. If not defined, pre-submission field validation is performed.
            </xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute type='exml:String' name='errorReader'>
          <xs:annotation>
            <xs:documentation>
              Optional. JSON is interpreted with no need for an errorReader. <p>A Reader which reads a single record from the returned data. The DataReader's <b>success</b> property specifies how submission success is determined. The Record's data provides the error messages to apply to any invalid form Fields.</p>
            </xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:anyAttribute namespace="http://www.jangaroo.net/exml/0.8 exml:untyped" processContents="skip"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name='Submit' type='efa:Submit_TYPE' substitutionGroup='ef:Action'>
    <xs:annotation>
      <xs:documentation>
        A class which handles submission of data from <a href="Ext.form.BasicForm.html">Form</a>s and processes the returned response. <p>Instances of this class are only created by a <a href="Ext.form.BasicForm.html">Form</a> when <a href="output/Ext.form.BasicForm.html#Ext.form.BasicForm-submit">submit</a>ting.</p><p><u><b>Response Packet Criteria</b></u></p><p>A response packet may contain:</p><div class="mdetail-params"><ul><li><b><code>success</code></b> property : Boolean <div class="sub-desc">The <code>success</code> property is required.</div></li><li><b><code>errors</code></b> property : Object <div class="sub-desc">The <code>errors</code> property, which is optional, contains error messages for invalid fields.</div></li></ul></div><p><u><b>JSON Packets</b></u></p><p>By default, response packets are assumed to be JSON, so a typical response packet may look like this:</p><pre><code>{ success: false, errors: { clientCode: "Client not found", portOfLoading: "This field must not be null" } }</code></pre><p>Other data may be placed into the response for processing by the <a href="Ext.form.BasicForm.html">Ext.form.BasicForm</a>'s callback or event handler methods. The object decoded from this JSON is available in the <a href="output/Ext.form.Action.html#Ext.form.Action-result">result</a> property.</p><p>Alternatively, if an <a href="output/Ext.form.Action.Submit.html#Ext.form.Action.Submit-errorReader">errorReader</a> is specified as an <a href="Ext.data.XmlReader.html">XmlReader</a>:</p><pre><code> errorReader: new Ext.data.XmlReader({ record : 'field', success: '&#64;success' }, [ 'id', 'msg' ] ) </code></pre><p>then the results may be sent back in XML format:</p><pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;message success="false"&gt; &lt;errors&gt; &lt;field&gt; &lt;id&gt;clientCode&lt;/id&gt; &lt;msg&gt;&lt;![CDATA[Code not found. &lt;br /&gt;&lt;i&gt;This is a test validation message from the server &lt;/i&gt;]]&gt;&lt;/msg&gt; &lt;/field&gt; &lt;field&gt; &lt;id&gt;portOfLoading&lt;/id&gt; &lt;msg&gt;&lt;![CDATA[Port not found. &lt;br /&gt;&lt;i&gt;This is a test validation message from the server &lt;/i&gt;]]&gt;&lt;/msg&gt; &lt;/field&gt; &lt;/errors&gt; &lt;/message&gt; </code></pre><p>Other elements may be placed into the response XML for processing by the <a href="Ext.form.BasicForm.html">Ext.form.BasicForm</a>'s callback or event handler methods. The XML document is available in the <a href="output/Ext.form.Action.Submit.html#Ext.form.Action.Submit-errorReader">errorReader</a>'s <a href="output/Ext.data.XmlReader.html#Ext.data.XmlReader-xmlData">xmlData</a> property.</p> <p>This class serves as a typed config object for constructor of class Submit.</p> <p>Copyright &#169; 2011 Sencha Inc.</p> @see ext.form.action.Submit
      </xs:documentation>
    </xs:annotation>
  </xs:element>
</xs:schema>
New to GrepCode? Check out our FAQ X