FilePickerOptions
The FilePickerOptions object contains options that are passed into blackberry.invoke.card.invokeFilePicker().
Installation:
To use this API in your project, add the invoke card plugin:
webworks plugin add com.blackberry.invoke.card
Learning Resources:
Sample - Set Wallpaper using File Picker Sample that demonstrates how to use the BlackBerry Invoke FilePicker API [BlackBerry on GitHub].
Properties: | |
---|---|
Boolean | allowOverwrite |
String[] | defaultSaveFileNames |
String | defaultType |
String[] | directory |
String[] | filter |
Boolean | imageCrop |
String | mode |
String | sortBy |
String | sortOrder |
String | title |
String[] | type |
String | viewMode |
allowOverwrite
A true or false that describes whether the file being saved can be overwritten or not. Defaults to false. It is only valid in FILEPICKER_MODE_SAVER and FILEPICKER_MODE_SAVER_MULTIPLE.
Synopsis:
Boolean FilePickerOptions.allowOverwrite = ""
defaultSaveFileNames
An array of strings that describes the FileName of the FilePicker when its invoked in Saver mode.
options.mode should either be FILEPICKER_MODE_SAVER or FILEPICKER_MODE_SAVER_MULTIPLE. Defaults to no file name. In FILEPICKER_MODE_SAVER mode it will only use the first item in this array and display the filename to the user. In FILEPICKER_MODE_SAVER_MULTIPLE it will only allow the user to select a folder and in the onDone call it will return the folder path appending with the fileNames.
Synopsis:
String[] FilePickerOptions.defaultSaveFileNames = []
defaultType
A string that describes the default type selected in the FilePicker dropdown.
Defaults to the first type in the array of option.type. Only takes affect if more than one options.type is selected. Available types can be found under properties.
Synopsis:
String FilePickerOptions.defaultType = ""
directory
An array of strings where only the first value in array describes the folder that will presented to the FilePicker, all other items will be ignored.
Defaults to the last folder that the picker was opened in. Recommended to be specified with every call to control the user experience.
Synopsis:
String[] FilePickerOptions.directory = []
filter
An array of strings that the file picker files should be filtered on. example [".jpg",".bmp"]. Defaults to no filter.
Synopsis:
String[] FilePickerOptions.filter = []
imageCrop
A true or false to describe the imageCrop. Defaults to false. It will only be allowed for pictures of format jpg, jpe, jpeg or png in mode FILEPICKER_MODE_PICKER and FILEPICKER_MODE_PICKER_MULTIPLE.
Synopsis:
Boolean FilePickerOptions.imageCrop = ""
mode
A string that describes the mode of the FilePicker. Available modes can be found under properties.
Synopsis:
String FilePickerOptions.mode = ""
sortBy
A string describes the FilePicker's sort by name or date or suffix or size. Available sort by fields can be found under properties.
Synopsis:
String FilePickerOptions.sortBy = ""
sortOrder
A string describes the viewer sort order of the FilePicker, such as ascending or descending or default layout. Defaults to default sort order. Available modes can be found under properties.
Synopsis:
String FilePickerOptions.sortOrder = ""
title
A string that describes the title of the FilePicker. Defaults to the folder name.
Synopsis:
String FilePickerOptions.title = ""
type
An array of strings that describes the type of files that the FilePicker will show. Defaults to showing all types. Available types can be found under properties.
Synopsis:
String[] FilePickerOptions.type = []
viewMode
A string describes the viewer mode of the FilePicker, such as grid or list layout. Available view modes can be found under properties.
Synopsis:
String FilePickerOptions.viewMode = ""
Last modified: 2014-10-09
Got questions about leaving a comment? Get answers from our Disqus FAQ.
comments powered by Disqus