« Return to Thread: AutoCompleter

Re: AutoCompleter

by Lukas Renggli :: Rate this Message:

Reply to Author | View in Thread

1. You need to store the autocompleter object in a JavaScript variable.

2. Then in the onSelected: event you can access the method
selectedIndex and serialize it to the client together with the
contents of the form element.

That looks somehow like this (as usual I haven't tested):

   html div
      class: 'autocomplete';
      script: (html autocompleter
         element: 'text';
         assignTo: 'auto';
         onSelected: (html request
            callback: [ :value | index := value asInteger ]
               value: (html autocompleter
                   alias: 'auto';
                   selectedIndex);
            triggerFormElement: 'text')

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

 « Return to Thread: AutoCompleter

LightInTheBox - Buy quality products at wholesale price