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
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer
Accepted Solution

Type error: Unknown type: Object is not an array.

Hi,

 

I'm manually populating a portion of my dataModel, if I set it to an Array then it doesn't seem to display anything, however if I set it to an object then it displays correctly, and compiles with no error, however within momentics I get the following error being displayed:

"Type error: Unknown type: Object is not an array."

 

is there a way around this..

 

.....

//var dataLine=new Array();
var dataLine = new Object();
dataLine["Title"] = "My Title";
dataLine["Description"] = "My Description";
myDataModel.append([dataLine]);

 



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
Hithredin
Posts: 404
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Type error: Unknown type: Object is not an array.

What kind of DataModel is yours?

Usually you append QObject, QVariant or QList.

Please use plain text.
Developer
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Re: Type error: Unknown type: Object is not an array.

[ Edited ]

Hi,,

 

My dataModel is a GroupDataModel and the code is all in QML/javascript where I am populating the GroupDataModel so I'm not sure how I would access QList , QMap ect.

 

after some more research I found an example like this: which seems to work

 

searchDataModel.append({
                        "Title": "MyTitle",
                        "Description": "Rome"
                       });

 

 



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.