Class Autocomplete

  • @Events("provideCompletions")
    public class Autocomplete
    extends java.lang.Object
    A mixin for a text field that allows for autocompletion of text fields. This is based on Twttter typeahead.js version 0.10.5. The container is responsible for providing an event handler for event "providecompletions". The context will be the partial input string sent from the client. The return value should be an array or list of completions, in presentation order. e.g.
     String[] onProvideCompletionsFromMyField(String input)
       return . . .;
    Component Parameters 
    NameTypeFlagsDefaultDefault Prefix
    contextObject[]Since 5.4 prop
    The context for the "providecompletions" event. This list of values will be converted into strings and included in the URI. The strings will be coerced back to whatever their values are and made available to event handler methods. The first parameter of the context passed to "providecompletions" event handlers will still be the partial string typed by the user, so the context passed through this parameter will be added from the second position on.
    frequencydouble  literal
    Overrides the default check frequency for determining whether to send a server request. The default is .4 seconds.
    maxSuggestionsint 5prop
    Maximum number of suggestions shown in the UI. It maps to Typeahead's "limit" option. Default value: 5.
    minCharsint  literal
    Overwrites the default minimum characters to trigger a server round trip (the default is 1).
    tokensString  literal
    If given, then the autocompleter will support multiple input values, seperated by any of the individual characters in the string.

    Component Events 

    • Constructor Summary

      Constructor Description
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait