In fact after some thinks , i could :
render XML or JSON from my controller, in order to send back user_ids
and names to populate the drop down list.
Modify the function callback , which receives the response as XML/JSON
for parsing and repainting the drop down list.
Each row in the dropdown list s enclosed by a a href with onclick
event, calling a function(with current user_id as argument) setting
the value in the Hidden field

What do you think of?

L

On 2 mai, 22:15, Laurent <[EMAIL PROTECTED]> wrote:
> Hello
>
> I would like to be able to do/reuse the autocompleter for the
> following thing.
>
> The field opened for autocompletion in my HTML form, will not based in
> my ActiveRecord (RoR), but declared as a new attribute like this:
>
> attr_accessor :name_search
>
> In this model class, i have an id (let's say user_id that is 'based'
> i.e when i persist into in database, i save this user_id but not the
> name_search) mapped to the correspomding column from the table.
>
> So with the Autocompleter (that i should extend i think), i would like
> to  :
> Open the search on the 'name_search' field, choose name in the list (i
> should find a means to have the user_id hidden in a div at each line),
> then :
> - set this name in the 'name_search' field
> - set the corresponding user_id in an hidden field.
> When clicking OK, i send the user_id information for saving...
>
> Had anyone already this kind of behaviour.
>
> Laurent


--~--~---------~--~----~------------~-------~--~----~
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