PDA

View Full Version : How to resolve this error "TypeError 'Prototype' is null or not an object"



sam.arulprakash
20 Jun 2010, 11:22 PM
Hi All,

I have tried with XMLReader with ComboBox.
But I am getting this error,from exception(Event)
"TypeError 'Prototype' is null or not an object''.

Response:My Xml String.

Any idea or suggestion about this error.

Thanks & Regards,
Arul Prakash.M


var cbReportType;
var cbReportType_ds;
var cbReportType_ArrayStore;
Ext.onReady(function()
{
Ext.QuickTips.init();

cbReportType_ds = new Ext.data.Store
({
proxy: new Ext.data.HttpProxy
({
url: "Test.asmx/Test",
method: "POST",
disableCaching: true
}),
reader: new Ext.data.XmlReader
({
record: 'Test',
id: 'SHPIMO_NR',
totalRecords: 'totalRecords'
}),
autoLoad: {
params: {
'some-param': 'some-value' // <- POST can only work if you have at least one parameter
}
},
listeners:
{
load:function()
{
},
exception: function(proxy, type, action, options, response, e)
{
alert('type: ' + type + '\naction: ' + action + '\nerror: ' + e + '\nresponse: ' + response.responseText);
},
loadexception:function(obj)
{
}
}
});


cbReportType = new Ext.form.ComboBox({
store: cbReportType_ds,
//typeAhead: true,
forceSelection: true,
triggerAction: 'all',
emptyText:'- Select a value -',
//selectOnFocus:true,
mode:'local',
displayField: 'SHPNAME',
applyTo: 'cbReportType_PhrsComboBoxText',
hiddenName: 'SHPIMO_NR',
valueField: 'SHPIMO_NR',
TextValue:function()
{
//return this.getStore().getAt(this.selectedIndex).data.shipIMONo;
return this.getValue();
},

Text:function()
{return this.getRawValue();},//return this.getValue();},
SetText:function(obj)
{return this.setValue(obj);},
ValidationError:function()
{

}
});











});


My Xml OutPut


<NewDataSet>
<Test>
<SHPNAME>FLEURTJE</SHPNAME>
<SHPIMO_NR>L1001702 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>ARCO BECK</SHPNAME>
<SHPIMO_NR>L8817722 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>OILSTONE</SHPNAME>
<SHPIMO_NR>L4902945 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>OILFIELD</SHPNAME>
<SHPIMO_NR>L4906410 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>ALLEGRO</SHPNAME>
<SHPIMO_NR>L5000172 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>TUNC</SHPNAME>
<SHPIMO_NR>L5000201 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>AL-MARKHANIYA</SHPNAME>
<SHPIMO_NR>L5000342 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>TELANBO</SHPNAME>
<SHPIMO_NR>L5000562 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>LE TRIEUX</SHPNAME>
<SHPIMO_NR>L5000782 </SHPIMO_NR>
</Test>
<Test>
<SHPNAME>HIOS</SHPNAME>
<SHPIMO_NR>L5000835 </SHPIMO_NR>
</Test>
<totalRecords>10</totalRecords>
</NewDataSet>

Condor
20 Jun 2010, 11:39 PM
Can you use ext-all-debug.js and post the stacktrace when this error happens?

ps. The config option is called totalProperty and not totalRecords.

sam.arulprakash
21 Jun 2010, 12:37 AM
Thanks condor for your reply.
I got the problem.
I have not mentioned ['SHPIMO_NR','SHPNAME'] in the reader.
Now it is working fine.

reader: new Ext.data.XmlReader
({
record: 'Test',
id: 'SHPIMO_NR',
totalRecords: 'totalRecords'
},['SHPIMO_NR','SHPNAME'])