PhotoAlbum Application Download Support Developer Guide
Skins:
Resources/Beans Handling
Ajax Miscellaneous
Usage
Tag Information

RichFaces Suggestion Box component adds the autocomplete capability to the existing input component such as h:inputText or t:inputText. Use the attribute 'for', in order to ping to the necessary input component to add the autocomplete capability to it.

Working with Suggestion Box is similar to the h:dataTable component, but instead of the 'value' attribute it has a suggestionAction attribute that points to the method that returns the filtered collection. The 'fetch' attribute points to the data that is inserted into the input field if a particular row is selected or clicked from the suggested list.

SuggestionBox example

Suggestion Box will suggest you states capitals names. Comma and square brackets could be used as suggestions separators."

Border
15
Width
150350
Height
100300
Shadow Depth
36
Shadow Opacity
19
Cellpadding
120


View Page Source


View CapitalsBean.java Source

And below there is the second example of new JS API and Objects selection feature usage.

Just choose some state from suggestion and capital name property will be fetched using client side API (Some of the capitals could be fetched separated with coma). No requests are required anymore. You could just store needed properties in the same manner in hidden fields for example.

Objects usage example
Input with states names suggestions
States capitals for suggested capitals


View Source
RichFaces Wiki RichFaces Project Site