rich:autocomplete does not expose @execute attribute, because it uses JSF ajax only for updating list of suggestions. This operation should not execute any other logic on the server.
If you want autocomplete to execute something on server, let's do some JSF ajax as callback to some action, e.g.:
<rich:autocomplete mode="ajax" autocompleteMethod="...">
<a4j:ajax event="change" execute="..." render="..." />
the onchange event is not fired when auto suggestion fired. I tried onkeypress,onkeyup and onkeydown too, none of them works. what i want is some other values are submited the same time as auto suggestion fired, i need them to construct the suggesiton liste. even thought i can submit these values in separate ajax request, i think it is a little regretful to not have execute on autosuggestion.
i am using latest RF4.3.3. those events are fired well. but its not what i need. i need autocomplete submit some others values than his input.
1 of 1 people found this helpful
Sorry, I misunderstood.
So I understand the use case, you want to use the state of other page inputs in populating the suggestion list of the autocomplete component, right? So a user changes the value of a page input (say inputA), then goes to the autocomplete method, and starts typing. You want the ajax request fired to populate the suggestion list to execute inputA with the ajax request to populate the suggestion list?
To me this seems in-efficient, as the value of inputA would be executed and included in the request with every keypress, while the value of inputA will not have changed between sequential keypresses. Seems like executing an ajax call when the autocomplete receives focus would be most desirable here. If not, please expand on your use case, and correct me where my assumptions are wrong.
yes your understanding is correct. I am migrating a RF3 projet to RF4, it worked like this. For me, an ajax request is a request, it could be slow even it is small. and I think it is not very costful to add 1 or 2 values in submit.
anyway, what i did is add a ajax on the others input's onchange event.