Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Getting Started with webOS Date, Time, Integer and File Pickers

Date, Time, Integer and File Pickers

Pickers are designed to help simplify and standardize the interface for certain types of user input. Mojo includes pickers for entering dates, times, numbers, and selecting files. The first three are "conventional" widgets, while the file picker is actually an application "wrapped with a framework interface".

Date picker


Allows selection of month, day, and year values.

mojo date picker

The model for the date picker widget includes a single property, named date by default, which should be assigned a JavaScript Date object. You can then use the standard JavaScript functions Get Month(), Get Date() or Get Year() to extract the input value.

Time Picker


Similar to the date picker, but includes an optional attributes property minuteInterval, which confines the allowable minute values to the increment specified (e.g. 5 minutes).

mojo time picker

12 or 24 hour format is automatically displayed based on the user's device preferences or locale. The JavaScript functions GetHours(), GetMinutes() and GetSeconds() can be used to extract information from the time picker's model object.

At time of writing, Palm has not yet provided an example of the attributes for the date or time picker widgets.

Integer Picker


This is a smiple number picker that allows the user to select integer values between a specified range. The allowable values can be restricted to a specified range using min and max attributes.

mojo integer picker

Click here for an example of how to set up an integer picker.

File Picker

x-mojo-element="FilePicker" (not yet confirmed)

webOS devices have a Media Partition, a FAT32 partition that is available to applications and accessible to desktop operating systems when the device is attached through a USB cable.

The file picker allows the user to navigate the directory structure of the partition and view and (optionally) select files. It also allows filtering by file type (e.g. file, image, audio, video, etc.).

mojo file picker

Depending on the options set at instantiation, either a file reference will be returned or the file will be opened in the appropriate viewer.

The file picker has been designed to behave like a full-screen widget but is actually an application that gets pushed into the current scene, similar to a viewer, maintaining the context of the calling application.

The presentation of files in the picker will differ by file type.

  • Files will be a list including filename and icon
  • Images will be presented in a thumbnail grid.
  • Audio and Video will be presented with filename and thumbnail.

That it for pickers. Next up is the filter list widget!

This is one of many daily development-related webOS articles. Grab the RSS feed to stay in the know!

Much of the information in this article was presented in Chapter 5 of Palm webOS by Mitch Allen.



    Add Comment

      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)