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
Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

ListView::selectionItems() does not return the proper number of items

I have ListView which uses a LitItemProvider that creates items which are derrived from CustomControl and ListItemListener.

 

When I have no items selected ListView::selectionItems() returns 0 as expected, but when i have one or more items selected it returns bogus values. For instance I only have two items in the list and when they are both selected it returns 4. 

 

Is this a known bug with ListView::selectionItems() or am I doing something wrong. 

 

Any feed back apprciated.  I am using the Gold Canidated by the way.

 

Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook
My Carrier: Rogers

Re: ListView::selectionItems() does not return the proper number of items

Try using

 

listview.selectionList();

 

That works for me.

---
If you find my post helpful please "like" it and "accept as a solution"
Highlighted
Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

Re: ListView::selectionItems() does not return the proper number of items

Thanks. Will give it a try.
Coming form the Qt world the MVC in cascade is another animal. Not sure it is so well thought out but maybe it just takes time to get used to.