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: 402
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Conditional formatting of Label

I am trying to format a Label of a ListItemComponent in a ListView. The format depends on an app variable that is exposed to QML. I have tried just about everything I can think of. The problem seems to be that my app variable isn't seen in the ListItemComponent item. I can add the app variable just about any place else in the QML files and it is seen. How do I make the variable visible to the ListView?

Contributor
Posts: 20
Registered: ‎02-21-2012
My Device: Bold 9900
My Carrier: AT&T

Re: Conditional formatting of Label

Have you tried

property variant text (or property string text, property QString text)

Then setting 'text = "blah"'

And then referring to "text"?
Developer
Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: Conditional formatting of Label

There are lots of similar threads on this board which discuss this. Do a quick search and you'll find the solution