Hey Loïc,

Loïc a écrit :
> Hello,
> i've tried this :
> 
> new Ajax.Autocompleter("nom", "autocomplete_choices", "getLogin.php", {
> minChars: 2,  indicator: 'indicator1', updateElement : getLogin});

OK, first, you do know that redefining updateElement will *replace*
regular option tokenizing and addition with your own, right?  Is this
really what you're trying to do?  The argument that is passed is the
HTMLOptionElement representing the selected item.

The default updateElement behavior performs all the processing described
in the wiki: filtering based either on the select option or by excluding
"internal"-class'd elements, then text concatenation, then either value
addition (defined 'token' option) or value replacement.  And of course,
calling the callback I mention in the next paragraph.  That's a LOT to
redefine properly, don't you think?

If you're just looking for a callback function to be called once the
selection was properly performed and has appeared in your autocompleted
field, use the afterUpdateElement callback.  It takes two arguments: the
autocompleted field and the HTMLOptionElement representing the selected
item.

-- 
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to