Results 1 to 2 of 2

Thread: 5.0.1 Error loading xml model, Uncaught Error: Invalid record id returned for [email protected]

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    106

    Default 5.0.1 Error loading xml model, Uncaught Error: Invalid record id returned for [email protected]

    Moving from Extjs 4.0.7 to ExtJs 5.0.1, we load XML configuration files on all our ext apps.

    The below snippet of code is a base xml model and a call from the controller onLaunch function, this works in ExtJs 4.x but I get the following error with 5.0.1

    Uncaught Error: Invalid record id returned for [email protected]tPasswordConfig


    Model:
    Code:
    Ext.define('lostpassword.model.XMLLostPasswordConfig', {
    	extend: 'Ext.data.Model',
    	fields: [
    		{name: 'formtitle', mapping: '/description/form-title', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		
    		{name: 'formTopMessage', mapping: '/description/top-message', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'formTopMessageInclude', mapping: '/description/top-message/@includeinform', type: 'int', defaultValue: false },
    		
    		{name: 'mysqlDateFormat', mapping: '/form/elements/@mysqldateformat', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		
    		{name: 'formLabelPosition', mapping: '/form/elements/@labelposition', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		
    		{name: 'statusZero', mapping: '/description/sitestatus/zero', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusFour', mapping: '/description/sitestatus/four', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusEight', mapping: '/description/sitestatus/eight', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusTen', mapping: '/description/sitestatus/ten', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusFourTeen', mapping: '/description/sitestatus/fourteen', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusTwenty', mapping: '/description/sitestatus/twenty', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusTwentyFour', mapping: '/description/sitestatus/twentyfour', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusNinety', mapping: '/description/sitestatus/ninety', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusNinetyFour', mapping: '/description/sitestatus/ninetyfour', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''},
    		{name: 'statusNinetyNine', mapping: '/description/sitestatus/ninetynine', type: 'string',convert: function(v){return Ext.String.trim(v);}, defaultValue:''}
    		
    	],
    	proxy: {
    		type: 'ajax',
    		reader: {
    			type: 'xml',
    			record: 'portal_auth_page_description'
    		}
        }
    });
    Call:

    Code:
    onLaunch: function() {	
    //check if the languge xml is already loaded
         	if (lostpasswordXML == undefined) {
    var objXml = this.getXMLLostPasswordConfigModel();
         		
         		var xmlPath = lostpasswordConfigObj.siteUrl + '/authentication/templates/lostpassword/lang/' + this.xinetLanguge + '/lostpasswordform.xml';
    //fetch the XML document
    		   	objXml.load(0,{
    	        	scope: this,
    	        	url: xmlPath,
    	        	callback: this.processXml//what to do when we get the xml
    		        
    		    });
         	} else {
    //xml is alreday loaded.
         		this.creatView();
         	}
         	
         	
    	},
    thanks in advance

  2. #2
    Touch Premium Member
    Join Date
    Mar 2012
    Posts
    106

    Default

    Ok, we've never has to do this before, but if I add an id field to the model

    Code:
    {name: 'id',    type: 'int', mapping: '/description/@recordid'},
    and then add an attribute to me xml

    Code:
    <description recordid="0">
    it now loads fine?

    If I set a defaultValue that does not work either.

    Code:
    {name: 'id',    type: 'int', defaultValue: 1},
    Odd that it now needs id defining and existing in the XML.

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •