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


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.


Reply
Contributor
Posts: 14
Registered: ‎10-04-2010
My Device: Not Specified

weird dropdown / color bug

in some code I was working on, I've found some weird behaviour with dropdown qml.

If I have the following qml snippet:

DropDown {
id: color1
title: "Choose Color"
 
                        Option {
                            text: "Red"
                            value: "red"
                        }
 
                        Option {
                            text: "Yellow"
                            value: "yellow"
                        }
}

and then try to access color1.selectedValue , i will get "#ff0000" or "#ffff00", not "red" and "yellow" as I would expect. if i switch the value in the Options to "solidRed" and "solidYellow" then I get the string back as is. i can obviously work around this in the way i choose my colors, but seems significant, particularly if dropdowns are user-defined - and not wanting to stumble upon any magic values. any confirmation as to what's going on here? or is there something in qml that I'm missing that makes this happen?

(note, this is in sdk 10.0.10.1672)

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: weird dropdown / color bug

I think this is similar to HTML/JavaScript/CSS.

 

For simplicity the user (developer) can input colors in clear named values... "Blue", "Red", "White" etc. but that's all it is... a way to easily set colors...

 

but internally the system uses actual RGB color values (it likely converts the values when setting them)... thus when inspected or script requests the set color... you get the HEX value instead.

 

#ff0000 is red

#ffff00 is yellow

#0000ff is blue

 

etc, etc.


PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****