MultiSelect FilePicker

Is it possible to give the user the ability to select multiple files, when the FilePicker appears - if so how?

I can show a FilePicker and I listen for the selection of a single file, so lack me a way to tell the FilePicker to enable multiple selection.

Thanks in advance.

John

Docs https://developer.blackberry.com/cascades/reference/bb__cascades__pickers__filepickermode.html#type

How the sample https://github.com/blackberry/Cascades-Samples/blob/master/filepicker/assets/main.qml

Tags: BlackBerry Developers

Similar Questions

  • Change filePicker 'Save' label of button in mode FilePickerMode.SaverMultiple

    Hello

    I use the FilePickerMode.SaverMultiple mode on a filePicker to allow the user to select a file for my application process. However, the label of the button 'Save' is very misleading. Is it possible to change the label of the button to something like 'Fact' or 'Select '?

    Or is there a better way to allow the user to select a folder?

    Not that the property is not exposed so that it can be variable.

    I agree it is an odd label and would have been nice to be editable, but seeing that it's compatible with all file pickers I worry it be misleading.

  • Specify several file types for filePicker

    Hello world

    When you specify a file type for a FilePicker, 'relevant' tab is made available on the left which includes all files of this type on your device on a single screen. I want to be able to have more than one of these tabs, so I guess that if I specify several file types that I can get the legs at all what I said.

    The FilePicker API reference for ' bb::cascades:ickers::FileType:Types defaultType "he's hinting that there is a way to specify more than one file type for a FilePicker. How can I do this?

    I got to try something that seems to work. In the use of definition FilePicker:

    type: FileType.Picture + FileType.Document + FileType.Music + FileType.Video + FileType.Other
    

    This puts a drop-down menu at the top of your filepicker where you can choose from any one of the types that you specify in the order that you specify. ('Other' Chooseing will give you the default view). Don't know if there is another or a better way to do this, but it works for now.

  • Photos poorly oriented when pulled from filepicker

    In my application I allow users to take a photo or select an image using the filepicker.  But when she shows the images in an imageView that they appear on the side and never in the correct position, no matter if they were taken without focus lock, or whatever.  When I invoke the display of images, howeverm images are always perfectly oriented.

    Is there anything I can do in my code to accommodate for this?  Orientation is off differently isn't tlike it's always oritented left, sometimes it's to the right, sometimes it is upside down, sometimes it's to the left.

    Hello

    I know exactly what is happening - I'm working on an app photo from last year, and I had the same problem.

    When the camera takes a photo, it adds some EXIF metadata in the JPEG file that indicates its "focus".

    In my opinion, the BB should add an ImageView option such as "autoOrient" so that it would automatically read and the picture rotates as appropriate before posting, but I don't think such a property exists. Thus, all the developers who want to display pictures must add this logic to their App (inefficient or what?)

    The good news is that there is a sample application that shows how to do this.  Take a look at the sample application "photobomber.

    I'll copy and paste the relevant code here:

    QImage PhotoBomberApp::getRotateImage(const QString imageFilePath)
    {
        //Load the image using QImage.
        QImage image = QImage(imageFilePath);
    
        ExifData *exifData = 0;
        ExifEntry *exifEntry = 0;
        int exifOrientation = 1;
    
        // Since the image will loose its exif data when its opened in a QImage
        // it has to be manually rotated according to the exif orientation.
        exifData = exif_data_new_from_file(imageFilePath.toLatin1().data());
    
        // Locate the orientation exif information.
        if (exifData != NULL) {
            for (int i = 0; i < EXIF_IFD_COUNT; i++) {
                exifEntry = exif_content_get_entry(exifData->ifd[i], EXIF_TAG_ORIENTATION);
    
                // If the entry corresponds to the orientation it will be a non zero pointer.
                if (exifEntry) {
                    exifOrientation = exif_get_short(exifEntry->data, exif_data_get_byte_order(exifData));
                    break;
                }
            }
        }
    
        // A transform will be used to rotate the image according to device and exif orientation.
        QTransform transform;
    
        qDebug() << "Exif data:" << exifOrientation;
    
        // It's a bit tricky to get the correct orientation of the image. A combination of
        // the way the the device is oriented and what the actual exif data says has to be used
        // in order to rotate it in the correct way.
        switch(exifOrientation) {
            case 1:
                // 0 degree rotation
                break;
            case 3:
                // 180 degree rotation
                transform.rotate(180);
                break;
            case 6:
                // 90 degree rotation
                transform.rotate(90);
                break;
            case 8:
                // 270 degree rotation
                transform.rotate(270);
                break;
            default:
                // Other orientations are mirrored orientations, do nothing.
                break;
        }
    
        // Perform the rotation of the image before its saved.
        image = image.transformed(transform);
    
        return image;
    }
    

    This code returns you a QImage, so you can or may not know how, then take that and display them in an ImageView. Incase it's useful, here's an example of my application relating to this code:

    QImage thisQImage = getRotateImage(...);
    
    bb::ImageData imageData = bb::ImageData::fromPixels(thisQImage.rgbSwapped().bits(), bb::PixelFormat::RGBX, thisQImage.width(), thisQImage.height(), thisQImage.bytesPerLine());
    
    bb::cascades::Image cascadesImage = imageData;
    
    imageView->setImage(cascadesImage);
    

    A final caveat is that doing each of these conversions between types of image data takes a little time, and so if you do it in the main thread of the application, you might or might not slow down the user interface.  I tried to move my loading image in another thread when it is possible, although I found (I think) the conversion in bb::cascades:Image does not work correctly if this isn't in the main thread, so I don't have this part and call setImage in the main thread.

    Hope that helps. Here the answer was simpler.

  • Error in the project in an attempt to FilePicker code...

    Hello, friends... I have a strange question...

    I put in work FilePicker in my code. I've done almost everything, I added this

    you have to add

    LIBS += -lbbcascadespickers
    

    in your .pro file?

  • Filepicker several files

    Hi all

    Try using filepicker to take several pictures and place them in different imageViews at the same time.

    That's what I have so far for one frame at a time:

    {FilePicker}
    ID: picker1
    Title: qsTr ("select an image")
    string selectedFile property
    mode: FilePickerMode.Picker
    type: FileType.Picture
    directories: [' / accounts/1000/shared/camera "]
    viewMode: FilePickerViewMode.GridView
    sortBy: FilePickerSortFlag.Date
    sortOrder: FilePickerSortOrder.Descending
    imageCropEnabled: true
    onFileSelected: {}
    selectedFile = selectedFiles [0]
    imgView1.imageSource = "file://" + selectedFile
    imgView1.visible = true
    imgView1.scaleX = 1
    imgView1.scaleY = 1
    imgView1.rotationZ = 0

    }
    }

    It works perfectly if I want to select a photo and place it in imgView1... but I imgView 1, 2, 3, 4, 5, 6, 7.

    I would use the file selector choose 7 photos and put them in each imgView. I use FilePickerMultiple and it works great but can't seem to the get into each imgView separately.

    Tried:

    imgView1.imageSource, imgView2.imageSource, imgView3.imageSource is "file://" + selectedFile

    Does not return an error but puts only the last selected photo imgView3 and not imgView1 or 2.

    Any help would be amazing.

    THX.

    Dpcanada

    Thank you very much!!!

    Worked surprisingly well... you're a genius... you made my day.

    This is what the code looks like on your help:

    {FilePicker}
    ID: picker7
    Title: qsTr ("select an image")
    string selectedFile property
    mode: FilePickerMode.PickerMultiple
    type: FileType.Picture
    directories: [' / accounts/1000/shared/camera "]
    viewMode: FilePickerViewMode.GridView
    sortBy: FilePickerSortFlag.Date
    sortOrder: FilePickerSortOrder.Descending
    imageCropEnabled: true
    onFileSelected: {}
    for (var i = 0; i)< selectedfiles.length;="">
    var selectedFile = selectedFiles [i];
    imgView.imageSource = "file://" + selectedFiles [0]
    imgView1.imageSource = "file://" + selectedFiles [1]
    imgView2.imageSource = "file://" + selectedFiles [2]
    imgView3.imageSource = "file://" + selectedFiles [3]
    imgView4.imageSource = "file://" + selectedFiles [4]
    imgView5.imageSource = "file://" + selectedFiles [5]
    imgView6.imageSource = "file://" + selectedFiles [6]
    imgView7.imageSource = "file://" + selectedFiles [7]

    }
    }
    }

    He brings in 7 different photos in separate different imgViews... Impressive... just great!

    Thank you.

    dpcanada

  • Display selectedfile filepicker

    Hey guys, I'm having some trouble getting the picture that I chose in the filepicker to display in an imageView.

    I have already read other messages about displaying images of filepicker and I tried their solutions, but still can't make it work. My imageView remains empty even if the imageView.source is correct when I print it.

    I am able to get the imageView to display a picture, if I combine the image as an asset, however.

    If someone could point me in the right direction, it would be much appreciated.

    In my qml file I have:

    Page {
        Container {
    
            ImageView {
                id: imgView
                objectName: "imgView"
                layoutProperties: StackLayoutProperties {
                    // make imgView to fill all available height
                    spaceQuota: 1.0
                }
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
                scalingMethod: ScalingMethod.AspectFit
            }
            Button {
                            id: button
                            horizontalAlignment: HorizontalAlignment.Center
                            topMargin: 100
    
                            text: qsTr ("Choose Picture")
                            onClicked: picker.open()
                        }
        }
         attachedObjects: [
                FilePicker {
                    id: picker
                    title: qsTr ("File Picker")
    
                    property string selectedFile
    
                    onFileSelected: {
                        selectedFile = selectedFiles[0]
                        imgView.imageSource = selectedFile
    
                    }
                }
            ]
    }
    

    access_shared

    This line is present in the file of the bar - descriptor.xml?

  • Broken defaultSaveFileNames FilePicker component QML property?

    I'm trying to use a FilePicker to back up and restore user data in a JSON file.  I'm the pre-population of the property with the name of the file defaultSaveFileNames is to have its extension (".json") removed when the UI FilePicker slides in on the application user interface.  Is - this just broken?  There is a thread WebWorks describing the same problem here:

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/invokeFilePicker-filter-options-...

            FilePicker {
                id: backupRestoreFilePicker
                type: FileType.Document
                directories : ["/accounts/1000/shared"]
                viewMode: FilePickerViewMode.ListView
            defaultSaveFileNames: ["userData.json"]
                onFileSelected: {
                    // handler code omitted
                }
            }
    

    The FilePicker UI does is display "userData" as suggests recorded file name.

    He adds the .json at the end of the file name, it it just hides the Textinput

    I use it and it adds .bar at the end of the file name, the user types into:
    {FilePicker}
    string saveName property
    ID: saver
    defaultSaveFileNames: ['.bar']
    mode: FilePickerMode.Saver
    Title: "download the update.
    directories: [' / accounts / "]

  • FilePicker on attachedObjects does not work?

    This is the simple app I'm working on that

    I want after a click in the action Go, a FilePicker bar will be shown, so I put the FilePicker on attachedObjects like this:

    // main.qml
    
    import bb.cascades 1.0
    
    NavigationPane {
        id: navigationPane
        backButtonsVisible: false
    
        // Create the initial screen
        Page {
            titleBar: TitleBar {
                title: qsTr("ExiView")
            }
    
            content: Container {
    
                TextArea {
                    id: lbl
                    editable: false
                    text: "Browse for an image, and ExiView will display its EXIF information for you."
                    textStyle {
                        color: Color.Black
                    }
    
                }
    
                // The file picker view mode selector
                DropDown {
                    id: pickerViewMode
    
                    horizontalAlignment: HorizontalAlignment.Center
    
                    title: qsTr("View Mode")
    
                    Option {
                        text: qsTr("Default")
                        value: FilePickerViewMode.Default
                        selected: true
                    }
    
                    Option {
                        text: qsTr("List View")
                        value: FilePickerViewMode.ListView
                    }
    
                    Option {
                        text: qsTr("Grid View")
                        value: FilePickerViewMode.GridView
                    }
                }
    
                // The file picker sort criterion selector
                DropDown {
                    id: pickerSortBy
    
                    horizontalAlignment: HorizontalAlignment.Center
    
                    title: qsTr("Sort by")
    
                    Option {
                        text: qsTr("Default")
                        value: FilePickerSortFlag.Default
                        selected: true
                    }
    
                    Option {
                        text: qsTr("Name")
                        value: FilePickerSortFlag.Name
                    }
    
                    Option {
                        text: qsTr("Date")
                        value: FilePickerSortFlag.Date
                    }
    
                    Option {
                        text: qsTr("Suffix")
                        value: FilePickerSortFlag.Suffix
                    }
    
                    Option {
                        text: qsTr("Size")
                        value: FilePickerSortFlag.Size
                    }
                }
    
                // The file picker sort order selector
                DropDown {
                    id: pickerSortOrder
    
                    horizontalAlignment: HorizontalAlignment.Center
    
                    title: qsTr("Sort order")
    
                    Option {
                        text: qsTr("Default")
                        value: FilePickerSortOrder.Default
                        selected: true
                    }
    
                    Option {
                        text: qsTr("Ascending")
                        value: FilePickerSortOrder.Ascending
                    }
    
                    Option {
                        text: qsTr("Descending")
                        value: FilePickerSortOrder.Descending
                    }
                }
            }
    
            actions: [
                // Create the "Push" action
                ActionItem {
                    title: "Go!"
                    ActionBar.placement: ActionBarPlacement.OnBar
    
                    // When this action is selected, create an object that's based
                    // on the ComponentDefinition below, and then push it on to
                    // the stack to display it
                    onTriggered: {
                        var newPage = detailsPage.createObject();
                        navigationPane.push(newPage);
                      // picker.open()
                    }
                }
            ]
    
            attachedObjects: [
    
                FilePicker {
                    id: picker
    
                    property string selectedFile
    
                    title: qsTr("Select image")
                    mode: pickerMode.selectedValue
                    type: FileType.Picture
                    viewMode: pickerViewMode.selectedValue
                    sortBy: pickerSortBy.selectedValue
                    sortOrder: pickerSortOrder.selectedValue
    
                    onFileSelected: {
                      //  selectedFile = selectedFiles[0]
                    }
                },
    
                ComponentDefinition {
                    id: detailsPage
                    source: "DetailsPage.qml"
                }
    
            ]
        } // end of Page
    }// end of NavigationPane
    

    It will not work. So where should I put the FilePicker?

    Hey anta40,

    Have you registered the Filepicker in main.cpp file?

    #include 
    
    // Register Filepicker
        qmlRegisterType("CustomComponent", 1, 0,"FilePicker");
    

    You will also need to include in the qml file

    import bb.cascades.pickers 1.0
    

    And in the .pro file

    LIBS   += -lbbcascadespickers
    

    Another thing, your withdrawal difficulty.

  • FilePicker are not displayed

    It's so strange. On the Simulator, FilePicker.show () causes the FilePicker to display on the screen as you would expect. I can choose my file does my trick throughout the day. So, I signed the COD file and transferred to my phone to test it on my phone. Now when FilePicker.show () is called, nothing happens.

    The Simulator is a 9500 Storm running OS 5.0.0.224

    My phone is a 9530 Storm running OS 5.0.0.32 8

            private MenuItem setBackground = new MenuItem("Set Background", 100, 2) {
                public void run(){
                    final FilePicker filePicker = FilePicker.getInstance();
    
                    /*
                    String startPath = "file:///store/home/user/pictures/";
                    filePicker.setPath(startPath);
                    String filterString = "jpg";
                    filePicker.setFilter(filterString);
                    */
    
                    String path = filePicker.show();
    
                    if(path != null && setBackgroundPath(path)){
                        updateBackground();
                    }
                }
            };
    

    As you can see I even pointed out that some of the additional parameters to FilePicker in the hope that it would be useful. Made no difference. Any ideas?

    I am able to reproduce this problem and sent to our development team.  You can use the following as a temporary work around.

    -How to create a popup of file selection screen
    Article number: DB-00724

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800256/...

  • How to close webworks.ui.filepicker in code

    Hello

    I am currently working on blackberry webworks project and I use webworks filepicker extension for the selection of files.

    Everyone and everything works well, but I overloaded the return key feature and now I want to close filepicker on previous key.

    Now my problem is back key is pulled and I got it too, but how can I close the file picker.

    Is there a code like "webworks.ui.file.close".

    Any help is really appreciated.

    Thank you

    Shoaib Mijaki

    First the filePicker comes with a Cancel button, that's why I'm confused about your question.

    where your back button does not appear after the file picker is called?

    Anyway, you can close all card child

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.Invoke.html#.closeChildCard

  • Filepicker example does not compile

    I downloaded the example filepicker, and they do not compile with the following error message:

    MAKEFILE_GENERATORC:\bbndk\host_10_0_9_52\win32\x86\usr\bin\ntox86-ld: cannot find - lfilepicker

     


    I was wondering how to fix this error?

    Updated now. Need someone to update the documentation and example

    Change the ViewMode to FilePickerViewMode

    The library reference must be LIBS +=-lbbcascadespickers instead of-lfilepicker

  • Multiple select FilePicker

    How can I use the qml FilePicker but allow users to select multiple files.

    I have it

    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__pickers__filepickermode.htm...

    mode: FilePickerMode.PickerMultiple

  • ControlledAccessException when using FilePicker.show)

    I am receiving a click on a button and try to show a filepicker. I am also using "UiApplication.getUiApplication (.invokeLater)" to ensure that it is on the edge of the event. After setting the filter, path and earphone "FilePicker.show ()" throw a ControlledAccessException with a null CodeSignedKey.

    It is probably important to note that this only occurs on the device, it works in the Simulator.

    Any help would be greatly appreciated, I have dealt with this for a while now.

    Right, he works on the Simulator, but not on the device.

    It is hard to believe that they are testing such things on the device before releasing.

    In particular, something like that where they kept touting it as a new feature in 5.0.

  • Failure of FilePicker

    Hi, I'm following the example of:

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__pickers__filepicker.html

    FilePicker is defined in bb::cascades:ickers space names.

    Add "using namespace bb::cascades:ickers ' to the .cpp file.

Maybe you are looking for