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
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA
Accepted Solution

Folder Picker?

[ Edited ]

Hi 

 

Is there a way to make FilePicker select and display only folders  (or any other cascades class? ) 

 

I have tried the save mode. It seems perfect except the fact that we have to set a file Name at the end.

Can we make it not ask for file name ?

 

I tried using QT QFileDialog but it just crashes the app

 

QString dir = QFileDialog::getExistingDirectory(0, tr("Open Directory"),
                                                   QString("/accounts/1000/removable/sdcard/"),
                                                   QFileDialog:: ShowDirsOnly | QFileDialog:: DontResolveSymlinks);

 

 

 

thanks

Please use plain text.
BlackBerry Development Advisor
erahnenfuehrer
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Folder Picker?

Please use plain text.
Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

Yes i tried that and its almost perfect , BUT we have to select a file name before close.

 

Saver mode expects to save a file at a location. I couldnt make it select only a folder.

What i want is for the user to be able to select just a folder which i can then use to search for some stuff. 

 

thanks

Please use plain text.
BlackBerry Development Advisor
erahnenfuehrer
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Folder Picker?

Ah, I see now where you said you already tried that :smileyhappy:

 

I just tried mode: FilePickerMode.SaverMultiple and that seems to do the trick!

 

Please use plain text.
Developer
borceg
Posts: 670
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: Folder Picker?

[ Edited ]

I used FilePicker in Saver mode without setting the file name in QML.

And, if I'm not wrong, you need to pick some folder with FilePicker and then use the returned path of it right ? 

Please use plain text.
Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

man ... how i miss that :smileyhappy:

it works great , thanks all

Please use plain text.
BlackBerry Employee
mbohacek
Posts: 2
Registered: ‎02-25-2013
My Device: BlackBerry Z10
My Carrier: O2 Czech republic

Re: Folder Picker?

Actually, using FilePickerMode.SaverMultiple can be also problematic. E.g. it won't allow you to select a folder if you don't have write permissions for it (but you should be able to select it for reading purposes). And you also cannot rename the "Save" button to something else. (E.g. "Select").

 

Please use plain text.
Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

I didnt test this but it seems logical for selecting a save folder and so will break for read only access.

 

Do we have any folder in shared / sdcard without write access ?

Please use plain text.
Contributor
maheshkumar1990
Posts: 44
Registered: ‎01-07-2013
My Device: 9300
My Carrier: blackberry

Re: Folder Picker?

Hi all,

        Am doing photo upload in BB-10, i have used filepicker in qml,when user clicks upload photo option i need to show only camera pictures and photos pictures,insted of that am showing all of the options like books,documents,music,print etc.. how can i filter only photos option..?

  directories : ["/accounts/1000/shared/camera"]

 i have used like this,but not getting correct result is there any other way to implement this

 Thanks 

Please use plain text.
Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook
My Carrier: NA

Re: Folder Picker?

https://developer.blackberry.com/cascades/reference/bb__cascades__pickers__filepicker.html#function-... says this

 

"If the directories are not specified,FilePicker, in Picker Mode, will display the folders associated with the specified file type or navigate to the default folder in Saver Mode"

 

So maybe you can try to set the file type filter as Picture

https://developer.blackberry.com/cascades/reference/bb__cascades__pickers__filepicker.html#property-...

 

 

Please use plain text.