Author: Tim Neil
- BlackBerry Bold 9700 v126.96.36.1999
- BlackBerry Storm 9550 v188.8.131.529
- BlackBerry Torch 9800 v184.108.40.206, v220.127.116.118
Requires BlackBerry WebWorks SDK for Smartphones v2.0 or higher
How To Configure The Extension For Use
Locate your BlackBerry WebWorks SDK for Smartphone extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks Packager\ext
Create a new webworks.ui.filePicker directory in the ext directory
Download the source from this repository and unzip it to a location on your computer
Using File Explorer browse to this extension's downloaded source code Smartphone\FilePicker
Copy the library.xml file from the downloaded Smartphone\FilePicker directory to your new ext\webworks.ui.filePicker directory
Copy the downloaded Smartphone\FilePicker\src directory to your new ext\webworks.ui.filePicker\src directory
NOTE: Be sure to back-up this ext\webworks.ui.filePicker directory in your WebWorks SDK extensions directory before performing a WebWorks SDK upgrade. Simply copy it back into the ext directory after you have completed your SDK upgrade.
Required Feature ID
Whenever you use the below feature id in any of your WebWorks applications this extension will be loaded for use.
<feature id="webworks.ui.filePicker" />
static void open(callback : function (filePath : Number) ) // If nothing is selected undefined is returned
When creating a spinner control you will pass it a callback function that will be invoked once the user selects a file. If no file is selected the callback will have undefined returned to it
NOTE: The callback is handled asynchronously, so code that is placed directly after the "open" function call will be executed immediately while waiting for the user's response input.
NOTE: If you override the back key in your application (blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, myExit);) you will need to null this out (blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, null);) before calling webworks.ui.filePicker.open. If you don’t do this, your app will perform the override action when a user clicks back in the FilePicker instead of moving back a directory or even closing the picker. Remember to re-associate your exit function in the FilePicker callback.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.