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
Sumitava_Datta
Posts: 83
Registered: ‎02-18-2013
My Device: Blackberry 10
My Carrier: airtel

Is it passable to show one list item in List view using group data model?

Help me.....

Thanks

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Is it passable to show one list item in List view using group data model?

sure. one is quite a small group, but it qualifies, at least for group data model.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Sumitava_Datta
Posts: 83
Registered: ‎02-18-2013
My Device: Blackberry 10
My Carrier: airtel

Re: Is it passable to show one list item in List view using group data model?

Sorry I don't understand kindly can you explain??

 

It will help me.

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Is it passable to show one list item in List view using group data model?

the answer to your question posed in the thread title: yes
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
Sumitava_Datta
Posts: 83
Registered: ‎02-18-2013
My Device: Blackberry 10
My Carrier: airtel

Re: Is it passable to show one list item in List view using group data model?

Ok.

I just show XML data from XML file which is located in assets file of my project,When the list data is more then one that time data show in list field but list data is one then listfield value doesn't show.

Please help me 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Is it passable to show one list item in List view using group data model?

If you have only one item, a GroupDataModel seems a bit pointless. Why not try changing to an ArrayDataModel and see if that makes the problem just go away?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
Sumitava_Datta
Posts: 83
Registered: ‎02-18-2013
My Device: Blackberry 10
My Carrier: airtel

Re: Is it passable to show one list item in List view using group data model?

Because I need to sort the data also by id.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Is it passable to show one list item in List view using group data model?

Even the concept of sorting is meaningless when there's only one item involved. There must be something missing from your description, since this still doesn't make sense.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Regular Contributor
Sumitava_Datta
Posts: 83
Registered: ‎02-18-2013
My Device: Blackberry 10
My Carrier: airtel

Re: Is it passable to show one list item in List view using group data model?

Thanks for your reply .

XML data are may be one or more then one . I am solving this problem .

 

If When I get one data from XML I just do ....

model->insert(list.value<QVariantMap>());

 else

model->insertList(list.value<QVariantList>());

 

And one more quarry is why I get numberOfHeaders values is 0 all time?

int numberOfHeaders = model->childCount(QVariantList());

 

How to get the count of model data?

Please use plain text.