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
Developer
Posts: 49
Registered: ‎08-13-2012
My Device: 9300

XmlDataModel could not open the file

Hi Guys,

 

I am trying make a simple list view.

 

It gives the  following error. 

 

XmlDataModel could not open the file  "file:///apps/com.example.Kayako.testDev_mple_Kayakod7f625f3/native/assets//qml/model.xml" 

 

Please help.

Developer
Posts: 71
Registered: ‎09-19-2012
My Device: Z10 very soon

Re: XmlDataModel could not open the file

check if your model.xml is in assets/qml folder in files system. I keep xml's in xml folder. 

 

ListView {
  dataModel: XmlDataModel {
  source: "xml/model.xml"
 }
}

pic.png

 

 

 

 

Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10

Re: XmlDataModel could not open the file

How are you setting the dataModel?  It looks like you have an extra "/" in your path:

 

"file:///apps/com.example.Kayako.testDev_mple_Kayakod7f625f3/native/assets//qml/model.xml"

 

It should be set in the form:

 

source: "models/stamps.xml"

 

Could you be setting it as:

 

source: "/models/stamps.xml"?

Developer
Posts: 71
Registered: ‎09-19-2012
My Device: Z10 very soon

Re: XmlDataModel could not open the file

send me your ziped project and I'll correct it and send you back.