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

Posts: 85
Registered: ‎06-22-2013
My Device: N/A
My Carrier: N/A

Assign DataModel to Picker.

Hello Guys,


I am using a Picker and i need to fill it with a GroupDataModel

Picker {
                dataModel:dataBase.loadName() //Function Returns GDM
                preferredRowCount: 0
                pickerItemComponents: [
                    PickerItemComponent {
                        content: Container {
                            Label {
                                text: pickerItemData.name.toString()


 the Picker Displays nothing, It wokrs for ListView very well.

Any Solution Please..... 

Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Assign DataModel to Picker.

Is database a C++ QObject?

You say it works well for the ListView is it exactly the same one?


Are you including your custom library at the top of the qml file?


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Posts: 85
Registered: ‎06-22-2013
My Device: N/A
My Carrier: N/A

Re: Assign DataModel to Picker.

dataBase is C++ object and included in the Qml.
In the same QML i'm using ListView and Picker with the same data model function, the ListView is Filled but not the Picker .
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Assign DataModel to Picker.

Hi esam_tec, please provide more details on the loadName function. Have you tried replacing the dataModel property with a replica datamodel in the assets folder? Please issue a jira ticket in case you think this is a bug in the API.




Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker