Function Render-Suggest

Part of:

package weblocks
( render-suggest < input-name > < resultset > &key < default-value > (input-id (gensym)) (choices-id (gensym)) (format-fn #'format-suggest-list) (max-length *max-raw-input-length*) < welcome-name > )
Renders a block that provides functionality similar to google-suggest.

'input-name' - the 'name' attribute of the input box.

If 'resultset' is a list of items, suggestions will be done via local
autocompletions cashed on the client. Otherwise, completion will be
done via an asynchronious call to the server ('resultset' must be set
to a function that accepts a search parameter and returns a list of
itmes that match). Note, if JavaScript is turned off local
autocompletion will degrade to a simple drowdown.

'default-value' - can be used to set the value of the input box and/or
dropdown. If 'default-value' is a list, car of the list will be used
to set the default value, and all subsequent elements will be used to
test dropdown elements (in case suggest degrades to dropdown). This is
useful because occassionally dropdown options have different names
than intended default value.

'input-id', 'choices-id' - optional IDs of input control and choice div,
respectively. If an ID isn't provided, it will be generated.

'format-fn' - a function used to format the results into html sent to
the client. Accepts a list of results.

'welcome-name' - a welcome option in case dropdown is used (see
'render-dropdown').