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: 196
Registered: ‎12-14-2009
My Device: Not Specified
Accepted Solution

How to reload a ListView when an item is removed/changed?

[ Edited ]

So I have a ListView in a Page that lists files.  And those selected files are sometimes renamed or deleted on Action Items' triggerings, how do I refresh the ListView to reflect these changes?

 

I would refresh my data model during the Action Item triggering. It would just be a matter of redisplaying the ListView with the new data model data.

 

It's not in a Navigation Pane so I can't push a ComponentDefinition.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: How to reload a ListView when an item is removed/changed?

 

Hi,

 

Have you tried of clearing the datamodel and re-inserting the data in it.

 

clear() - http://developer.blackberry.com/cascades/reference/bb__cascades__groupdatamodel.html#function-clear

insertList() - http://developer.blackberry.com/cascades/reference/bb__cascades__groupdatamodel.html#function-insert...

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to reload a ListView when an item is removed/changed?

If you are managing the DataModel yourself, can you not just emit an appropriate signal, and the ListView will react accordingly?  For example, if you delete an entry, then emit

itemRemoved (QVariantListindexPath)

 

Seems to work for me. 

Developer
Posts: 24
Registered: ‎05-16-2013
My Device: Developer
My Carrier: Developer

Re: How to reload a ListView when an item is removed/changed?

[ Edited ]

@kanaksony How can I do it with qml ?