The type-ahead page is a JSP that is rendered periodically as the user types text in the search box. The frequency of rendering the page is controlled by the JavaScript autocompleter function, which typically polls for changes several times a second.

The following is an example of a type-ahead page that uses the atg.search.formhandlers.TypeAheadDroplet. This servlet bean submits a request of class atg.search.routing.command.search.TypeAheadRequest and then renders the results. Most of the input parameters for the servlet bean are passed into the page as query parameters when the page is posted by the JavaScript function.

<dsp:page>
<ul>
<dsp:droplet name="/atg/search/formhandlers/TypeAheadDroplet">
  <dsp:param bean="/atg/search/formhandlers/SearchContext" name="context"/>
  <dsp:param name="text" param="q"/>
  <dsp:param name="environment" param="environment"/>
  <dsp:param name="language" param="language"/>
  <dsp:oparam name="itemformat">
    <li><dsp:valueof param="match"/></li>
  </dsp:oparam>
</dsp:droplet>
</ul>
</dsp:page>

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices