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
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor
Accepted Solution

Dropdown list item access

Hi,

 

I have a dropdown list in my app. I have done that in my QML file. Now, on clicking a button in the page, I should get a pop up asking the confirmation of the item I selected from the dropdown list. How can I get the item I selected in the list and display it ? can someone help pls 

 

thanks

Please like this if you are answered.
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Dropdown list item access

https://developer.blackberry.com/cascades/reference/bb__cascades__dropdown.html#property-selectedopt...
as a property you can reference it in qml with a dot, so myDropDownId.selectedOption
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: Dropdown list item access

[ Edited ]

Thanks .. I tried it and it shows an error like " selectedOption() does not return a value. Please check my code here..

        Button {
            text: "submit"
            translationY: 670.0
            scaleX: 0.9
            scaleY: 1.0
            translationX: 210.0

        attachedObjects: [
            SystemDialog {
                id: dialog
                title: qsTr("Confirm!")
                body: qsTr(" Card Number ") + cardNoText.text + qsTr(" Option ") + dropdown.selectedOption()+ qsTr(". Continue?")
                onFinished: {
                    if (dialog.result == SystemUiResult.ConfirmButtonSelection) _myexample.showSuccessMessage();
                }
            }
        ]
        onClicked: {
            dialog.show()
        }

 Actually this gets crashed even when I dont use the dropdown id.

Please like this if you are answered.
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Dropdown list item access

no brackets. it is a property, not a function/method.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: Dropdown list item access

Oh .. ok.. thanks alot.. but as I said, it crashes when I run the progm.. if I remove this attachedObjects block from the code, it works fine. Anything is wrong in this code? 

Please like this if you are answered.
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: Dropdown list item access

[ Edited ]

 Never mind.. I resolved the crash by adding  "import bb.system 1.0" in the qml file.

 

thank you..

 

Please like this if you are answered.