Auto Suggestion Example

The web is becoming very dynamic, and chances are new JavaScript user-interface features will be discovered/created and will become popular.

While normal Jaxcent programming requires no JavaScript expertise, to work with new, advanced or cutting edge feaures, some JavaScript expertise will indeed be required to integrate the feature with Jaxcent. Fortunately, it is easy in Jaxcent to integrate new JavaScript items.

This page shows an example of integrating an "AutoSuggest" feature, as provided by Nicholas C. Zakas at the

web site. (A drop-list version is also available.)

The website has a downloadable example. The example has a method that provides suggestions from a given list. (It works with IE and Firefox.)

To integrate it with Jaxcent, we simply modify the file suggestions1.js from the original example, so that it forwards the JavaScript call on to Jaxcent using JaxcentServerRequest and also provides a callback method JaxcentSuggestCallback that the Java code can call with the list of suggestions.

Following text is from the original website. However, here the suggestions are coming from the Java code at the server.

Type a state name into the textbox below. Make sure the state name begins with a capital letter. The best example is to type "Missouri" one letter at a time. You will get suggestions of "Maine", "Michigan", "Mississippi", and then finally "Missouri".

Try it for yourself:

To see a drop-list version, please visit AutoSuggestSample2.html