Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when using rich:autocomplete component ajax call from autocomplete.js file renders the data

 
conny pemfors
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam using the rich:autocomplete component in jsf but when adding jquery scripts to remove data from the input combobox component it removes the data but puts back the data from before pressing save button.
Any ideas of where the rich component stores the input data and places it back in the combobox, I guess it has to do with the autocomplete.js script file where it renders back before save is submitted.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18276
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The RichFaces autocomplete component polls the server each time you change the text in the textbox part of the combobox. It completely replaces the OPTION elements in the associated dropdown list each time it does so - the autocomplete method returns the updated option list values.

If you want a long and happy life, you won't attempt to run javascript of your own while this is going on, although you can add scripts that are fired before and/or after the autocomplete server method is invoked.

The autocomplete suggestion list is only sent to the client. It is not sent back to the server. There's no point therefore in modifying it yourself prior to submitting the form. And as far as filtering it, it's a lot easier - and more efficient - to put whatever filtering you need in the server-side autocomplete method than to mess around with stuff after it was sent to the client.
 
conny pemfors
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for input. the issue was solved on the server side instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic