SU autocompleter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SU autocompleter

Gerhard Obermann
Hi!
 
Is it possible to get back the real object using the scriptaculous autocompleter.
By default only the display string is set to the input field.
But i need the real selected instance from the dropdown list.
 
br
 
Gerhard

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SU autocompleter

Lukas Renggli
> Is it possible to get back the real object using the scriptaculous
> autocompleter.
> By default only the display string is set to the input field.
> But i need the real selected instance from the dropdown list.

See PRAjaxSearchWidget, the search widget of Pier. It assigns a
passenger to each list item and seralized it back to the server.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SU autocompleter

Gerhard Obermann
Hi Lukas!
 
It works, thanks a lot!
 
But i dont fully understand the magic of the selection handler!
 
br
 
Gerhard
 
selectionHandlerOn: html
 ^ html evaluator
  callback: [ :value | properties at: 'result' put: (html context callbacks at: value ifAbsent: [ nil ]) ]
   value: (SUStream new
    nextPutAll: 'arguments[1].id.match';
    argument: SUSortable passengerRegexp;
    nextPutAll: '[1]')

On Fri, Mar 21, 2008 at 7:46 PM, Lukas Renggli <[hidden email]> wrote:
> Is it possible to get back the real object using the scriptaculous
> autocompleter.
> By default only the display string is set to the input field.
> But i need the real selected instance from the dropdown list.

See PRAjaxSearchWidget, the search widget of Pier. It assigns a
passenger to each list item and seralized it back to the server.

Cheers,
Lukas

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


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: SU autocompleter

jtuchel

Gerhard Obermann <obi068 <at> gmail.com> writes:

>
> Hi Lukas!
>  
> It works, thanks a lot!
>  
> But i dont fully understand the magic of the selection handler!
>  
> br
>  
> Gerhard

Gerhard,

we had a similar issue and implemented a server-side association / search for
the returned displayString. The idea behind it being that thus no additional
data gets sent around. While the implementation seems a bit like doing the same
thing more often than necessary, it keeps the code and http messaging leaner. At
list in our opinion. I think we shouldn't try to do everything in JS just
because one can ;-)

cu

Joachim



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside