Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 21
Registered: ‎12-02-2012
My Device: BB10 Alpha Dev B
My Carrier: TrueMove-H

Is it possible to load xml from url to ListView ?

Is it possible to load  xml from url to ListView ?

Sample url : http://www.w3schools.com/xml/note.xml

 

Thanks,

Developer
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10
My Carrier: Personal

Re: Is it possible to load xml from url to ListView ?

[ Edited ]

yes with groupDataModel and a Data Source

ListView {
			  
			                                id: listview
			                                dataModel: groupDataModel


listItemComponents: [
ListItemComponent {
type: "item"



StandardListItem {


title: to

}

}]			                                
			                                    

}

attachedObjects: [
			            GroupDataModel {
			                id: groupDataModel
			                grouping: ItemGrouping.None
			                sortingKeys: [ "pubDate" ]
			                sortedAscending: false
			                
			            },
			            DataSource {
			                id: dataSource
                            source: " http://www.w3schools.com/xml/note.xml"

			                query: "rss/channel/item"
		                    onDataLoaded: {
		                        groupDataModel.insertList(data);
		                    }


                		}
]

 

If you find this information useful please click like --->
@mezeitune on twitter
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: Is it possible to load xml from url to ListView ?

see this link 

 

http://developer.blackberry.com/native/documentation/cascades/device_platform/data_access/using_data...

 

you can find the sample code under heading 

 

Loading data from a remote source