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: 313
Registered: ‎03-13-2013
My Device: Z10
My Carrier: Tim

Re: Dropodown selectedValue

If I know the issue I don't write a post! ahahah

If this post is helpful, please click the "like" button! Smiley Happy
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Dropodown selectedValue

I misunderstood you, sorry.

 

So this

onClicked:{
    if (dropdown.selectedValue == 1){
        label2.text = qsTr("fruit")
    }
}

 works for me with 10.1 and 10.2 API, and it doesn't work for you?

Are you tried clean the project and build it again? 



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 313
Registered: ‎03-13-2013
My Device: Z10
My Carrier: Tim

Re: Dropodown selectedValue

Ok, I find it! I have a 2 dropdown and with one if it works but with two no

onClicked: {
                        if(dropdown.selectedValue==1)if(dorpdown2.selectedValue=3){
                            label1.text = qsTr("text")
                        }
                    }

 

If this post is helpful, please click the "like" button! Smiley Happy
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Dropodown selectedValue

[ Edited ]

Oh, this can't work. The ( if()if ) statements is bad.

if(dropdown.selectedValue==1)if(dorpdown2.selectedValue=3)

Try this:

if(dropdown.selectedValue == 1 || dropdown2.selectedValue == 3){
    label1.text = qsTr("text")
}


If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 313
Registered: ‎03-13-2013
My Device: Z10
My Carrier: Tim

Re: Dropodown selectedValue

Ahhhhhhhhh really stupid error!! 1000 like for you! Thanks so so so much
If this post is helpful, please click the "like" button! Smiley Happy
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Dropodown selectedValue

Isn't stupid. We all make mistakes, sometimes  Smiley Wink



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 313
Registered: ‎03-13-2013
My Device: Z10
My Carrier: Tim

Re: Dropodown selectedValue

Luckily you were there!
If this post is helpful, please click the "like" button! Smiley Happy
Developer
Posts: 313
Registered: ‎03-13-2013
My Device: Z10
My Carrier: Tim

Re: Dropodown selectedValue

Another last question, if the user doesn't choose anything the value is 0?

If this post is helpful, please click the "like" button! Smiley Happy
Highlighted
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Dropodown selectedValue

The default selectedValue is an invalid QVariant, if the selected option has no value set, or no option is selected.



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog