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
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

file browser dialog box issue

Hello,

 

I want to use images i.e I had added in the shared forlder of the target using the native filebrowser dialog box api.

I am successfully able to create the filebrowser dialog box,

I had added some images to the folder

"/accounts/1000/shared/photos/"

 

Now when I open the file browser dialog its not showing me the photos of this folder.

So I want to know where should I set the Images  to view in the filebrowser dialog box.

 

this images I can use with the file path. So images are on the device but its not showing me in the filebrowser dialog.

 

Please help me I need it urgent.

Thanks in advance.

bskania.

Please use plain text.
Developer
ekke
Posts: 1,460
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: file browser dialog box issue

did you set the filter correct for the FileBrowser to get images

 

ActionItem {
            title: qsTr("Select Image") + Retranslate.onLanguageChanged
            imageSource: "asset:///images/ics/5-content-picture81.png"
            ActionBar.placement: ActionBarPlacement.InOverflow
            onTriggered: {
                // native FileDialog from c++
                filebrowseDialog.filters = [
                    "*.jpg",
                    "*.jpeg",
                    "*.png",
                    "*.gif"
                ]
                filebrowseDialog.show();
            }
        }

 

 

for me FileBrowser works well

(looks ugly on Dev Alphas - but this is because it's from old PlayBook Browser)

I can select images and then do a Preview in QML with ImageView

 

FileBrowseDialog {
            id: filebrowseDialog
            multiselect: false
            // filters set from ActionItem
            onSelectionCompleted: {
                // something selected ?
                if (filebrowseDialog.filepaths.length > 0) {
                    // is there a preview ?
                    // isImage ?
                    if (fileInfo.isImage(filebrowseDialog.filepaths[0])) {
                        roomsListPage.previewImage(filebrowseDialog.filepaths[0]);
                        return;
                    }
                    .......
                }
            }
            onSelectionCancelled: {
                // filebrowseDialogLabel.text = qsTr("browsing files cancelled") + Retranslate.onLanguageChanged;
            }
        },
        // FileInfo
        FileInfo {
            id: fileInfo
        }

 

 

you find the FileBrowser (C++) and FileInfo (C++) and my ImagePreview.qml in my open source project
 at github

 

https://github.com/blackberry/opendataspace-cascades

 

have fun and see you at BBJam in San Jose

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: file browser dialog box issue

I had used this only, But still no image is shown in file browser.
Please use plain text.
Developer
ekke
Posts: 1,460
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: file browser dialog box issue

yes - the browser only displays checkboxes you can click

the space of the image preview is empty

 

you have to wait for next betas to get a BB10 native file browse dialog

 

----

browsing for videos I'm getting a thumbnail from file browser

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: file browser dialog box issue

Hello,
checkboxes are also not there.
Please use plain text.
Developer
ekke
Posts: 1,460
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: file browser dialog box issue


bskania wrote:
Hello,
checkboxes are also not there.

there's a white square

try to tap on it

and you'll make the checked box visible

 

you can also copy some files to your dev alpha -

I did it with .txt, .pdf, .zip

these are fully visible

 

screenshot filebrowserdialog alpha device

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: file browser dialog box issue

Hello,

 

I had attached 2 images.

One is the view where I had added all the images.

Now I am using the Filebrowser dialog box to view images.

file browser dialog is opened but I am not able to view any images.

 

code to open the filebrowser dialog is

         

import bb.cascades 1.0
import Dialog.FileBrowse 1.0
//-- create one page with a label and text

Page {
    Container {
        attachedObjects: [
            FileBrowseDialog {
                id: filebrowseDialog
                multiselect: false
                // filters set from ActionItem
                onSelectionCompleted: {
                    // something selected ?
                    if (filebrowseDialog.filepaths.length > 0) {
                        // is there a preview ?
                        // isImage ?
                        console.log("Selected file " + filebrowseDialog.filepaths[0])
                    }
                }
                onSelectionCancelled: {
                    // filebrowseDialogLabel.text = qsTr("browsing files cancelled") + Retranslate.onLanguageChanged;
                }
            }
        ]
        id: containerID
        Label {
            text: qsTr("Hello world")
        }
        Button {
            text: "clicked"
            onClicked: {
                filebrowseDialog.filters = [
                    "*.jpg",
                    "*.jpeg",
                    "*.png",
                    "*.gif"
                ]
                filebrowseDialog.show();
            }
        }
    }
}

 

Now What is my mistake late me know.

bskania.

thanks.

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

Re: file browser dialog box issue

Ooops, you all forgot one bug. BB10 simulator currently does not support listing/browsing the filesystem with filebrowsedialog. They said it'll be fixed in next releases maybe. Same problem with playbook simulator.

On device(I tested on PB) filebrowse dialog works fine, files are shown within appropriate directory
Please use plain text.
Developer
bskania
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: file browser dialog box issue

thanks.
So currently we need to make some custom dialog which will display image if we want to work with SDcard images.
Please use plain text.