1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    22
    Vote Rating
    0
    lukasw44 is on a distinguished road

      0  

    Default Ext form panel using errorReader

    Ext form panel using errorReader


    hello i have got problem to configure my form and using errorReader

    i have got standard formPanel with some textfield eq. 'role', 'tmpPhoto' etc
    and i need add server validation . In ext site example is only one example with xml, but my server controller (spring) return error validation message as JSON. And this is example JSON error message :
    PHP Code:
    {"success":false,"errors":{"tmpPhoto":"tmpPhoto must not be null","role":"role must not be null"}} 
    so what i get i get root element as errors and fieldName --> error . I wrote something like that:
    PHP Code:
    Ext.define('bandsman.error',{
            
    extend'Ext.data.Model',
            
    fields:['tmpPhoto','role']
        }) 
    And in form i have got :

    PHP Code:
    errorReaderExt.create('Ext.data.reader.Json',{
                
    id'jsonReader',
                
    root'errors',
                
    model'bandsman.error',
                
    successProperty'@success'
                
            
    }), 
    but its not working for me , in errorReader doc they wrote that error message must have got id and msg its so complicated for me ...

    Can yout tell me how can i do this ?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Please read the requirements for errorReader again:
    errorReader should return records with id and msg fields
    [{name: 'id', mapping: 'field'}, {name: 'msg', mapping: 'message'}];

    Scott.

  3. #3
    Sencha Premium Member koushlendr's Avatar
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    10
    Vote Rating
    1
    koushlendr is on a distinguished road

      0  

    Default Error reader issue while rendering

    Error reader issue while rendering


    1. json response after form submit ::

    {"success":"false","errors":[{"id":"java.home","msg":"Java Home is required and cannot be empty"},{"id":"admin.password","msg":"AppServer Admin Password is required and cannot be empty"}]}

    2. ErrorReader configuration in form ::

    errorReader : new Ext.data.reader.Json({
    root: 'errors',
    successProperty: 'success',
    model : 'Manh.model.layout.install.InstallErrors'
    }),

    3. Model definition for error reader:

    Ext.define('Manh.model.layout.install.InstallErrors', {
    extend: 'Ext.data.Model',
    fields: ['id', 'msg']
    });

    Still error reader not working as i get model undefined in ext-all-dev.js on below lines.

    if (me.lastFieldGeneration !== me.model.prototype.fields.generation) {
    me.buildExtractors(true);
    }

    Need help to resolve this.

Thread Participants: 2

Tags for this Thread

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..."