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
Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Folder Picker?

[ Edited ]

Hi,

   Thanks for reply,do have any samples to invoke only pictures dirctory (as like done in twitter) using qml..

 Thanks, 

Developer
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

No i never tried it but you have generic samples in FilePicker and as the doc mentions,

try to use Picker Mode + dont set directories  + set the FileType to Picture

 

Hopefully it will show only image specific folders as the doc says.

Contributor
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Folder Picker?

Hi,

    Thanks for the reply, i have used like this for filepicker 

 attachedObjects: [
                    FilePicker {
                        id: filePicker
                        type : FileType.Picture
                        title: "Select Picture"
                           onFileSelected: {
                            imagepath = selectedFiles[0];
                            isImageSelected = true
                            imageattached_label.visible=true
                        }
                    }
                ]

 But i am getting the resukt like IMG_00000136.png

 

is there any other way to show only pictures..?

Thanks

Developer
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

[ Edited ]

The image is not visible.

 

Make sure you register all types that you use in qml

ex

    qmlRegisterType<bb::cascades:: pickers::FilePicker>("FP", 1, 0,"FilePicker");
    qmlRegisterUncreatableType<bb::cascades:: pickers::FilePickerMode>("FP", 1, 0, "FilePickerMode" ,"");
    qmlRegisterUncreatableType<bb::cascades:: pickers::FileType>("FP", 1, 0, "FileType" ,"");

This worked for me and i think i see only photos in my app.

 

Your code looks ok and since mode is Picker by default , you should only see folders related to images as per documentation of setDirectories()

 

if you are still stuck and no one else replies try creating a new thread as i marked this as solved

 

EDIT : btw you can also use setFilter() to filter on file name/extensions