On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor <[EMAIL PROTECTED]>
wrote:

>
> ""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor <
> [EMAIL PROTECTED]>
> > wrote:
> > they pretty much have that in the scriptacuous lib under
> > Ajax.Autocompleter,
> > atm
> >
>
> OK, but my control only does the Ajax call when the user clicks the Go
> button, whereas the scriptaculous library does an Ajax call everytime the
> user presses a key.


not quite;  it checks to see if anything has been entered in intervals that
are specified by the frequency parameter.  this allows users to potentially
enter in several characters depending on the frequency interval.  with the
stock setting, i was able to type about 5 or 6 characters before an ajax
request was issued.  and its smart enough not to just incite an ajax request
at every interval, because during the intervals, it checks to see if
anything has been entered.
you can easily analyze this behavior w/ the demo links i posted and
firebugs' net tab.  furthermore it has the tokens option.  tokens enforce a
tighter requirement on whether or not an autocompletion request will be
invoked; in the case of Ajax.Autocompleter that means sending an ajax
request to the server.  not only do characters have to have been entered
during the frequency interval, but one of the token characters has to have
been entered.  pretty slick if u ask me.
you could easily add support for explicit autocompletion request (eg. by
clicking a button) by subclassing Autocompleter.Base or one of the current
subclasses (Ajax.Autocompleter or Autocompleter.Local) as long as those
actually made sense for what you were trying to do.
so scriptaculous has supplied performance conscience, convenient (for users
and developers) controls and the ability to extend upon their work (using
prototypes oo features).

-nathan

Reply via email to