wood burning stoves*
The moose likes JSF and the fly likes when using rich:autocomplete component ajax call from autocomplete.js file renders the data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "when using rich:autocomplete component ajax call from autocomplete.js file renders the data" Watch "when using rich:autocomplete component ajax call from autocomplete.js file renders the data" New topic
Author

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

conny pemfors
Greenhorn

Joined: Oct 19, 2007
Posts: 29
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.


SCJD 1.5<br />SCJP 1.5
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
conny pemfors
Greenhorn

Joined: Oct 19, 2007
Posts: 29
thanks for input. the issue was solved on the server side instead.
 
jQuery in Action, 2nd edition
 
subject: when using rich:autocomplete component ajax call from autocomplete.js file renders the data
 
Similar Threads
Using Swing to Create Data Entry Forms
Textfield/Combobox with auto complete feature!
javabeans
Jtable loading after being saved problem
Serialization??