PDA

View Full Version : Possible bug in XmlReader/Grid


jimmy.honeycutt
01-18-2008, 10:45 AM
I am using XStream to convert my Java Objects into XML to be returned in the AJAX request. The XStream creates the following XML with an object com.acme.example.Test:

<com.acme.example.Test></com.acme.example.Test>

Using this code in creating the data store in an Ext.grid.Grid:

// create the Data Store
var ds = new Ext.data.Store({
// load using HTTP
proxy: new Ext.data.HttpProxy({url: 'test.do'}),

// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
record: 'com.acme.example.Test'
}, [
{name: 'id', mapping: 'id'},
{name: 'name', mapping: 'name'}
])
});

With this scenario, no data is displayed in the grid. However, if I change the xml record to just 'Test' and return a flat XML string from server (i.e. <Test></Test> instead of <com.acme.example.Test></com.acme.example.Test>), the data does display.

Anybody have a clue why this is not working? Any help or direction would be much appreciated.

Thanks!

tryanDLS
01-18-2008, 11:00 AM
I don't believe the periods are valid. JavaScript will try to treat those as property names of an object.