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: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone
Accepted Solution

dynamically create and bind datamodel and listview

Hi,

 

I have searched through forums and examples but in all example listview/datamodel are bound from the starting of the app only .I need to create and bind it dynamically. Because my listview data will depend upon selection of previous form. Need to do it using qml.Can someone help me?

Rujuta Trivedi
Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: dynamically create and bind datamodel and listview

I suggest you to refer with the sample application of tldr ,accounts or rssnews. After you read it all through, you will find the solution for you.




p(^_^)q
Good good study, day day up
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: dynamically create and bind datamodel and listview

Hi, I have gone through the examples. I have dynamically generated data,added to qvariantlist and then datamodel. Checked that data was inserted in datamodel(checked its size). But when I called it in qml using datamodel:  its displaying blank.

Rujuta Trivedi
Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: dynamically create and bind datamodel and listview

I have not seen your souce code only can guess the possibility.

 

Have you set up the query, like "query: "/xxx/yyy""? Can you add log to the your customized DataSource to check the loop of data iteration?

 

If you can show your brief source code, it willl be quick to analysis.




p(^_^)q
Good good study, day day up
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: dynamically create and bind datamodel and listview

Actually my data won't be displayed using single query,its 2 queries depending on one after another.

Rujuta Trivedi
Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: dynamically create and bind datamodel and listview

I don't get it. the query what i mentioned is for parsing the xml or json.

 

May you show part of your source code?




p(^_^)q
Good good study, day day up
Highlighted
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: dynamically create and bind datamodel and listview

it wasn't using json or xml,was using query. Its now working using datasource only.Thanks

Rujuta Trivedi