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

Web and WebWorks Development

Reply
Developer
Posts: 123
Registered: ‎02-13-2012
My Device: Z10 LE
My Carrier: Mobistar

invokeFilePicker filter options not working

Whenever I try to filter the files in a filepicker it won't display any files, even though I'm sure there are files with the specified extentions. (the files show up like normal when I don't specify a filter) Below is one of the many versions of my code I have tried:

 

blackberry.invoke.card.invokeFilePicker(
            {
                mode: blackberry.invoke.card.FILEPICKER_MODE_SAVER,
                type: [blackberry.invoke.card.FILEPICKER_TYPE_DOCUMENT],
                directory: [blackberry.io.sharedFolder],
                allowOverwrite: true,
                defaultSaveFileNames: [graph.title + ".csv"],
                filter: [".CSV"],
                viewMode: blackberry.invoke.card.FILEPICKER_VIEWER_MODE_LIST,
                sortBy: blackberry.invoke.card.FILEPICKER_SORT_BY_NAME,
                sortOrder: blackberry.invoke.card.FILEPICKER_SORT_ORDER_ASCENDING
            }, function (path) { saveCSV(path, separator, header, callback) }, function (reason) {
                console.log('cancelled: ' + reason)
            }, function (error) {
                if (error) {
                    console.log("invoke error: " + error);
                } else {
                    console.log("invoke success");
                }
            })

I have tried [".csv"], ["csv"], [".CSV"], [".png"], [".plottr"] etc. I also tried different types, FILEPICKER_TYPE_DOCUMENT, FILEPICKER_TYPE_OTHER, no type...

Please click the like button if my post helped you! Thank you.
Highlighted
Developer
Posts: 123
Registered: ‎02-13-2012
My Device: Z10 LE
My Carrier: Mobistar

Re: invokeFilePicker filter options not working

Another issue I encountered with the filepicker is that when I specify a directory you can't go to parent folders of that directory, only subfolders. Is there a reason why this happens, is there a workaround for this?

Please click the like button if my post helped you! Thank you.
Developer
Posts: 1,251
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: invokeFilePicker filter options not working

[ Edited ]

I'm running into the same issue.  I try to use the defaultSaveFileNames property of a FilePicker QML component to prepopulate the picker w/the suggested save file name (it's a JSON file) however when the file picker displays, the file name textbox is populated with the filename with the extension chopped off.

 

Is this just broken?

 

Edit:  Oops, sorry, I just realized this is the WebWorks forum.  I am observiing this problem in a Cascades app.