Quick Review:Ajax
Cross-platform programming with Java technology and the IBM Web Services Toolkit for Mobile Devices

User interface: Differences in List implementations

The differences in GUI controls’ appearance on various devices of the sort we just described is to be expected; you can plan around such differences without too much difficulty. However, the differing behavior of the same control across devices is cause for more concern.

For example, the List control displays a list of items to be selected. The user is presented with a list of text and/or images. The user can make a selection, and the application takes action based on the item(s) selected. The List control supports three types: Multiple, Exclusive, and Implicit. According to the documentation for MIDP (see Resources), List types work as follows:

  • The user can use a List of type Multiple to select one or more items. However, the process of selecting the items does not in itself generate a selection event. The user must take another action, like pressing a button or activating a menu choice, before the program queries the list to determine what item(s) were selected.
  • A List of type Exclusive allows the user to select only one item. However, as with the Multiple-type List, the user doesn’t generate a selection event by changing the selected item. The programmer must provide a button or menu choice to enable the user to confirm the choice made; activating this choice or button prompts the program to query the List and determine which item was selected.
  • The Implicit-type List is the only List that is supposed to automatically generate a selection event when an item in the List is selected. Only one item may be selected at a time, and each time the selection item is changed, a selection event is automatically generated.

Unfortunately, as implemented on the three platforms I’m describing here, the List control does not always demonstrate the behavior documented for it. Furthermore, the behavior of the List control differed from platform to platform, making it impossible to use this control in any cross-platform applications. Let’s look at these inconsistencies in detail.

List control on Palm OS4 devices

Under Palm OS4 platform, each time you select an item in a Multiple- or Exclusive-type List, a selection event is generated. This behavior is not consistent with the MIDP documentation. For an Implicit-type List, at no time are selection events generated. To use this type of List under Palm OS4 platform, you would need to provide a menu item that, when selected by the user, prompts the app to query the list to see which item has been selected. This behavior is also not consistent with the MIDP documentation; a programmer writing an application to the MIDP spec would probably not provide such a menu item, thus making the Implicit useless on this platform.

List control on Compaq iPAQ Pocket PC with PocketPC 2002

Under Pocket PC 2002 platform on the Compaq iPAQ device, for both Multiple- and Exclusive-type Lists, no events are generated when you select List items. This behavior is consistent with the MIDP documentation.

For an Implicit-type List, however, there are problems. If you attempt to select an item using the stylus, the iPAQ device’s touchscreen will not properly change the item selection. If you use the five-way hardware button, you can select items properly; pressing the center of the five-way hardware button then generates a selection event. This behavior is consistent with the MIDP documentation for List; however, the lack of touchscreen control with this type of List is bothersome, and is most likely a bug in the MIDP implementation for this device.

List control on BlackBerry 5810 Handheld
Because the BlackBerry device does not have a touchscreen, items are highlighted by moving the

June 2008 | Java Jazz Up |36
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,   Download PDF