autocomplete - Struts2 jQuery autocompleter not working -


currently doing struts up-gradation task (struts2.0 struts2.5). want replace struts dojo tag struts-jquery.

here facing issue when replace struts-dojo autocompleter struts-jquery autocompleter.

getting below response server :

  [   {     "firstname": "bulwark technologies llc",     "partnerid": 925   },   {     "firstname": "bulwark technologies llc1",     "partnerid": 926   },   {     "firstname": "bulwark technologies llc2",     "partnerid": 927   } ] 

for displaying @ client side using struts2-jquery-autocompleter -

<sj:autocompleter href="%{urlpartnerlist}" list="%{partnernamelistbeanstruts2}" listvalue="firstname" listkey="partnerid"/> 

i getting "undefined (multiple times - based on result found in query @ server side)" in textbox.

could 1 please here? in advance.

enter image description here

my suggestions in comments lead in wrong direction, <sj:autocompleter/> should work fine without changing server response. messed various options, available tag.

<sj:autocompleter href="%{jsonaction}" listkey="partnerid" listvalue="firstname" name="firstname"/> 

how can value of label element?

the trick autocompleter is, listvalue shown selection in visible text field listkey used value in hidden field. , hidden field used send value server. should answer question:

the <sj:autocompleter/> create following html code:

<input type="hidden" name="firstname" value="here_it_will_put_the_list_key"/> <input type="text" name="firstname_widget" value="here_it_will_put_the_list_value"/> 

thus have set listkey tag list property name want have response.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -