Hi, I needing to modify the control.js file and am confused about what the purpose of the getToken function is. I read the docs section below and still don''t understand why it doesn''t just access the form.value directly. Docs say: This method should get the text for which to provide autocompletion by invoking this.getToken(), NOT by directly accessing this.element.value. This is to allow incremental tokenized autocompletion. Does anyone understand the getToken function?? Thanks!
AFAIK it's because some autocompletion fields might take multiple values and be delimited by characters like a comma or space. The get token method allows you to get the last keyword/tag the user is entering and instead of the whole value. On 18/05/06, Daniel Elmore <danielelmore@gmail.com> wrote:> Hi, I needing to modify the control.js file and am confused about what the > purpose of the getToken function is. I read the docs section below and still > don't understand why it doesn't just access the form.value directly. > > Docs say: > This method should get the text for which to provide autocompletion by > invoking this.getToken(), NOT by directly accessing this.element.value. This > is to allow incremental tokenized autocompletion. > > Does anyone understand the getToken function?? > > Thanks! > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Andrew _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ah, I see. Looking at the code, what you said makes since. I guess that would be for typing in "tags" or something like that. Thanks -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Andrew Tetlaw Sent: Wednesday, May 17, 2006 5:47 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Autocomplete GetToken?? AFAIK it''s because some autocompletion fields might take multiple values and be delimited by characters like a comma or space. The get token method allows you to get the last keyword/tag the user is entering and instead of the whole value. On 18/05/06, Daniel Elmore <danielelmore-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I needing to modify the control.js file and am confused about what the > purpose of the getToken function is. I read the docs section below andstill> don''t understand why it doesn''t just access the form.value directly. > > Docs say: > This method should get the text for which to provide autocompletion by > invoking this.getToken(), NOT by directly accessing this.element.value.This> is to allow incremental tokenized autocompletion. > > Does anyone understand the getToken function?? > > Thanks! > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Andrew
url = http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "/url/on/server", {paramName: "value", minChars: 2, updateElement: addItemToList}); can''t understand this... who isĀ addItemToList ? _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs