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
anta40
Posts: 224
Registered: ‎07-26-2010
My Device: Z10

Re: How to display a picture after chosen via FilePicker?

I figured it out. Small typos here and there (e.g navigation.push(), navitationPane.pushPage(), etc etc).

Current QML editor is not smart enough to alert users about this kind of error.

 

FilePicker {
                id: picker

                property string selectedFile
                property Page secondPage
                
                function getSecondPage(){
                    if (!secondPage){
                        secondPage = secondPageDefinition.createObject()   
                    }
                    return secondPage
                }
                
                
                title: qsTr ("Browse for file")
                mode: FilePicker.Picker
                type: FilePicker.Picture
                viewMode: pickerViewMode.selectedValue
                sortBy: pickerSortBy.selectedValue
                sortOrder: pickerSortOrder.selectedValue
                
             
                onFileSelected: {
                    selectedFile = selectedFiles[0]
                    var ppp = getSecondPage()
                   // secondPage.imagePath = selectedFile
                    navigationPane.push(ppp)
                }
            }

 

Please use plain text.