PDA

View Full Version : view is undefine, loading combo box issue in 4.07



Anthony.Hall
29 Feb 2012, 3:35 AM
I am occassionally ( usually 1 in 3 page loads) receive the following error message


view is undefined view.onItemSelect(record);


In my view



{
xtype:'combobox',
name:'PurchaseOrderStatusId',
id:'PurchaseOrderStatusCombo',
displayField:'Name',
store:'PurchaseOrderStatuses',
mode:'local',
valueField:'Id',
fieldLabel:'Status',
width: 350
},
{
xtype:'combobox',
name:'SupplierId',
id:'SupplierCombo',
displayField:'Name',
store:'Suppliers',
mode:'local',
valueField:'Id',
fieldLabel:'Suppliers',
width: 350
},
// in my controller onLaunch: function () {



var suppliers = this.getSuppliersStore();
suppliers.load();


var purchaseOrderStatuses = this.getPurchaseOrderStatusesStore();
purchaseOrderStatuses.load();


var purchaseOrdersStore = this.getPurchaseOrdersStore();
purchaseOrdersStore.load({
callback: this.onPurchaseOrderLoad,
scope: this
});
},
onPurchaseOrderLoad: function (selection) {
var form = Ext.getCmp('purchaseOrderForm');
form.loadRecord(selection[0]);
},
in my model



{
mapping:'PurchaseOrderStatusId',
name:'PurchaseOrderStatusId'
},
{
mapping:'SupplierId',
name:'SupplierId'
}

skirtle
29 Feb 2012, 6:10 AM
You should start by analysing the stacktrace. If you can't figure out what the problem is then post the stacktrace here, possibly someone else will be able to make sense of it. The key things to investigate are which lines in your code cause the error and exactly what is view in the context of that message.