Autocomplete never submit value #27

Closed
fanf opened this Issue Jun 21, 2009 · 3 comments

Comments

Projects
None yet
3 participants

fanf commented Jun 21, 2009

Hello,

I'm playing with the Autocomplete widget in Lift 1.1 current SNAPTHOT version (generated on Sat Jun 20 06:47:53 PDT 2009) and I get the submitted value back in the Scala code, everything else works fine (autocomplete elements are shonw, etc). I'm quite new to lift, so perhaps I miss somthing obious.

I think that the problem is in the generated Javascript, when the selected value should be copied in the hidden field (line 131 of lift-widgets-1.1-SNAPSHOT-sources.jar!/net/liftweb/widgets/autocomplete/AutoComplete.scala, in "onLoad" value definition):
8<--------------
jQuery("#"""+id+"""").autocomplete(data, """+autocompleteOptions.toJsCmd+""").result(function(event, dt, formatted) {
jQuery("#"""+hidden+"""").val(dt.nonce);
8<--------------

The problem seems to be that dt has no "nonce" field, it's an array. If I modify the code as follow:
8<--------------
jQuery("#"""+id+"""").autocomplete(data, """+autocompleteOptions.toJsCmd+""").result(function(event, dt, formatted) {
jQuery("#"""+hidden+"""").val(formatted);
8<--------------

Everything works as expected.

Hope it may help ! Francois Armand

Member

mariusdanciu commented Jun 22, 2009

Fixed. Thank you very much Francois.

@ghost ghost assigned mariusdanciu Mar 1, 2012

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment