Search fields

Use search fields to allow users to search for items in an application. Several BlackBerry® device applications include search fields. For example, in the task list, users can use a search field to search for specific tasks.

As users type text in a search field, the application searches for and displays items that begin with the search text. If users type multiple words in the search field, the application displays results that match both words. For example, if users type "ca ba", the application returns all items with a word that begins with "ca" and a word that begins with "ba" (such as "call back").

Users can perform the following actions in a search field:

Action

BlackBerry devices without a touch screen

BlackBerry devices with a touch screen

Open a highlighted item in the search results.

Press the Enter key or click the trackwheel, trackball, or trackpad.

Click the screen.

Delete the text in a search field.

Press the Escape key.

Press the Escape key.


This screen shows a search field.

To help users type a specific value quickly, you can create a field that supports autocompletion. As users type, a list of suggested values appears in a drop-down list. Users can click a value or continue typing to restrict the values in the list.


This screen shows a field that supports autocompletion.

Best practice: Implementing search fields

  • Provide a search field when you have a constrained list of items.
  • Use the KeywordFilterField class to create search fields. For more information about creating search fields, see the API reference guide for the BlackBerry® Java® Development Environment and the BlackBerry Java Application UI and Navigation Development Guide.
  • Use the AutoCompleteField class and the BasicFilteredList class to create autocomplete fields. For more information about creating autocomplete fields, see the API reference guide for the BlackBerry® Java® Development Environment and the BlackBerry Java Application UI and Navigation Development Guide.
  • Allow users to use the Escape key to delete search text that they type.
  • Set the default focus to the search field and the first item in the list.
  • Display items in the search results that contain a word that begins with the typed search text.
  • Do not assign shortcut keys for a screen that includes a search field. If you want to use shortcut keys and you have a constrained list of items, provide alternative search functionality. For example, users can search for messages in a message list by pressing S or using the menu.
  • Place a search field in the title bar of an application screen.
  • Do not make search fields case sensitive.

Guidelines for labels

  • Use the label "Find:" for the search field.
  • Do not include prompt text in the search field.

Index


Was this information helpful? Send us your comments.