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
New Developer
laclekim
Posts: 41
Registered: ‎02-11-2010
My Device: Bold 9000
My Carrier: AT&T

Access dropdown selectedItem value

I'm making an app with multiple identical drop downs. To avoid duplicating code, I created a custom QML page that I can use to quickly duplicate the dropdown. However, now I can't access the selected value. Is there an easy way to access the selected value? 

 

main.qml

 

                        Container {
                            layout: StackLayout {
                                orientation:   LayoutOrientation.TopToBottom
                            }
                            GradeDropDown {
                                classNo: "Class 1: "
                                id: letterGrade1
                            }
                            GradeDropDown {
                                classNo: "Class 2: "
                                id: letterGrade2
                            }
                            GradeDropDown {
                                classNo: "Class 3: "
                                id: letterGrade3
                            }
                            GradeDropDown {
                                classNo: "Class 4: "
                                id: letterGrade4
                            }
                         }

 dropdown.qml

Container {
    id: gDropDown
    property alias classNo: classGrade.title
    property alias grdPts: classGrade.SelectedValue
    layout: StackLayout {
        orientation: LayoutOrientation.LeftToRight
    }

 I'm using an alias in the dropdown to try to get the selected value, but it's not working...

Please use plain text.