01-17-2013 12:18 PM
Hi, following on from a previous thread of mine regarding using an xml file with child elements in a list view, I am having great difficulty in implementing the solution of using a groupdatamodel with a datasource.
I have an xml file with the following stucture
<data success="1" status="200"> <item> <id>Cot4g</id> <title>So someone posted a split pic earlier</title> </item> <item> <id>Xz56B</id> <title>Shower this man in Karma</title> </item> </data>
I am trying to populate a list view with the information and the examples I am following just aren't working for me. Each <item> will populate the listview but I cant seem to get the code working. Can anyone give me a hand in implementing this?
01-17-2013 01:50 PM
This is what you should be using, not groupdatamodel.
Example is ok, I prefer
01-17-2013 01:56 PM
The problem I've had with that is that it doesn't work with the format of the xml file I have. It needs to use attributes rather than child elements. I was directed to use a DataSource and GroupDataModel as they can handle xml files with child elements.
01-17-2013 03:45 PM
Try with an ArrayDataModel. I've found the GroupDataModel + DataSource combo to be less than reliable. Unless there's some reason you need the grouping feature? Just remember that insertList(data) becomes append(data).