1. #1
    Sencha User chesstrix's Avatar
    Join Date
    Apr 2008
    Posts
    117
    Vote Rating
    1
    chesstrix is on a distinguished road

      0  

    Default [solved][4.1 RC3] form errorReader as Ext.data.reader.Xml does not fire markInvalid()

    [solved][4.1 RC3] form errorReader as Ext.data.reader.Xml does not fire markInvalid()


    Hi Folks,

    I have a form basically identical to your xmlForm example. When the submit() function fires it does not fire the markInvalid() function on return.

    Before anybody asks, "yes" I'm sure my xml return is actually xml.

    My research shows Ext.form.action.Submit.onSuccess does not set the result var correctly so result.errors is null/undefined when this.processResponse returns

    Code:
    onSuccess: function(response) {
        var form = this.form,
        success = true,
        result = this.processResponse(response);
        if (result !== true && !result.success) {
            if (result.errors) {
                form.markInvalid(result.errors);
            }
            this.failureType = Ext.form.action.Action.SERVER_INVALID;
            success = false;
        }
        form.afterAction(this, success);
    },
    My xml is...

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
      <message success="false">
        <errors>
          <field>
            <id>pUserName</id>
            <msg><![CDATA[Invalid username/password combination.]]></msg>
          </field>
          <field>
            <id>pPassword</id>
            <msg><![CDATA[Invalid username/password combination.]]></msg>
          </field>
        </errors>
      </message>
    My form is...
    Code:
    Ext.onReady(function() {
        
        Ext.define('Songle.fielderror', {
            extend: 'Ext.data.Model',
            fields: ['id', 'msg']
        });
        
       Ext.create('Ext.form.Panel', {
            renderTo : "logonForm",
            title : 'Songle Logon',
            id: "LogonPanel",
            bodyStyle : 'padding: 30px',
            width : 400,
            waitMsgTarget: true,
            // configure how to read the XML errors
            errorReader: Ext.create('Ext.data.reader.Xml', {
                model: 'Songle.fielderror',
                record : 'id',
                successProperty: '@success'
            }),
            fieldDefaults : {
                labelAlign : 'top',
                msgTarget : 'side'
            },
            defaults : {
                border : false,
                xtype : 'panel',
                flex : 1,
                layout : 'anchor'
            },
            items : [{
                xtype : 'textfield',
                fieldLabel : 'Username or email',
                anchor : '100%',
                cls: "loginlabel",
                name : 'pUserName',
                allowBlank: false
            }, {
                xtype : 'textfield',
                fieldLabel : 'Password',
                anchor : '100%',
                cls: "loginlabel",
                name : 'pPassword',
                inputType: 'password',
                allowBlank: false
            }],
            buttons : ['->', {
                text : 'Logon',
                disabled: true,
                formBind: true,
                handler: function(){
                    var f = this.up('form').getForm();
                    f.submit({
                        url: '../songledb/s2_access.logon',
                        submitEmptyText: false,
                        waitMsg: 'Checking Username and Password...'
                    });
                }
            }]
        });
    });

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,580
    Vote Rating
    314
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Shouldn't this:

    Code:
    record : 'id',
    be this?

    Code:
    record : 'field',

  3. #3
    Sencha User chesstrix's Avatar
    Join Date
    Apr 2008
    Posts
    117
    Vote Rating
    1
    chesstrix is on a distinguished road

      0  

    Default


    Thanks skirtle. I changed that in an attempt tp get it to work (when something else was wrong) and never changed it back.

    Thanks for the gentle poke.

  4. #4
    Sencha User chesstrix's Avatar
    Join Date
    Apr 2008
    Posts
    117
    Vote Rating
    1
    chesstrix is on a distinguished road

      0  

    Default


    Hmmmm..... anyone know how I now edit the title of the post to say [solved]???

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi