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

Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Retrieve the indexPath

Hello All, I need to set a variant in qml to the dataModel data at a specific indexpath like follows: 


var data= dataModel.data(indexPath);


the only issue is, while this is fine when selected from the listview, as it assigns the value of indexpath, I need to do this without having the list clicked. I know I want to access the most recent one added to the dataModel, so it is the last one in the hierarchy is illustrated here: https://developer.blackberry.com/cascades/documentation/ui/lists/list_view_selection.html


what is the best way to retrieve this data without having the listview supply the indexPath? I will continue looking into a solution.

Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: Retrieve the indexPath

Have you seen the Knowledge Base Article on using Data Models? This might give you some useful information.