Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete never submit value #27

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

Autocomplete never submit value #27

fanf opened this issue Jun 21, 2009 · 3 comments
Assignees
Labels
Milestone

Comments

@fanf
Copy link

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

@mariusdanciu
Copy link
Member

Fixed. Thank you very much Francois.

@github-importer
Copy link

Imported from GitHub: http://github.com/dpp/liftweb/issues/27/find

@github-importer
Copy link

Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/27

@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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants