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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 48
Registered: ‎10-11-2012
My Device: Z10
My Carrier: none

bb::cascades::Picker & GroupDataModel

1)The standard way if you want to show several columns in the Picker is to use several PickerItemComponent. Each of PickerItemComponents would describe its part of data for selection.


2)Another task in using Picker is to use sorted list of options for selecting. The typical recommendations for this is to use GroupDataModel. But if you will try it, you will get something strange and not expected.


So, what you will get and how to use it ? Unfortunately I did not found any information about this and everything was got from experiments.


The results of experiments if you will use GroupDataModel with Picker :

1) If you will setGrouping(ItemGrouping::None) for GroupDataModel you will get no visible data in your picker

2) If you will sort your data and default Grouping mode you will get as many columns in your Picker as many groups would be found in your data. As example if your data has field "name" and values "Mark", "Mike", "Andrew", so sorting by this field would get two columns in the Picker. First column with one value "Andrew" and the second column with values "Mark" and "Mike". Each row in each column would use the same visible form of PickerItemComponent with type="item" (because this type is returned by GroupDataModel, so you have to define such one component).

3) If you want to have only one column with sorted data you have to add one field with same data to each data entry for GroupDataModel and make sorting by this field firstly, this would create one group, so Picker will show only one column and you will have data sorted because you would define your sorting field as a second parameter for sorting in your GroupDataModel.


If some one knows where is a normal documentation for using different data models in the Picker, please leave link in comment.

Also I would like to know about another ways to show sorted dynamical data for Picker, so if you have your idea you are welcome !