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: 136
Registered: ‎02-01-2009
My Device: Not Specified
Accepted Solution

Updating GroupDataModel element of List for Lazy Loading

I have a ListView of StandardListCompoenet's which is created through a GroupDataModel in C++.

 

Post a button click, i have to change the text content from a row of the ListView based upon the row number typed by user in a text box.

 

Going as per GroupDataModel's API - updateItem(indexPath,QVariantMap), it can be done, provided i'm able to construct of get the indexPath.

 

There is a trigger(QVariantList) method of the ListView - which returns the indexPath of the element selected by user.

 

Since, in my code I only have the indexNumber of the row from user, is there a way I can construct the 'indexPath' for the 'updateItem' from my code itself.

 

Or should be there by any other strategy that would be opted instead of this?

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: Updating GroupDataModel element of List for Lazy Loading

Found the solution,

the key is to start finding the QVariantList(s) from the dataModel->first()

and then reach to the destination by comparing the data values.

Then, it wont be required to construct a data Path, it would be same as the one received in trigger(QVariantList)
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Updating GroupDataModel element of List for Lazy Loading

Thanks for posting your solution.

 

Given the size of the list you are likely dealing with and that this is in response to a user action, this should perform fine.  (Might not be scalable to extreme cases).

 

Stuart

Developer
Posts: 136
Registered: ‎02-01-2009
My Device: Not Specified

Re: Updating GroupDataModel element of List for Lazy Loading

Out of curiosity and might help the board members,is there an optimized approach to it?