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.
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.