This content has been marked as final.
Show 1 reply
-
1. Re: rich autocomplete send parameter before executing autocompleteMethod
javajosey Oct 11, 2011 3:52 PM (in response to zeroshade)Hello Pablo,
I had a similiar problem. My page has to transfer information about the autocomplete before the autocomplete request is done. I achieved this by using jsFunction. My autocomplete looks like:
<rich:autocomplete mode="ajax" showButton="true" value="#{conf.fieldValue}" autocompleteMethod="#{BackingBean.search.autocomplete}" minChars="3" onfocus="sendInfo('#{conf.label}')"> </rich:autocomplete>
Depending on conf.label (conf is a forEach variable) different data is fetched by the backing bean in the autocomplete method.
The transfer of this information is done by jsFunction (just after the autocomplete declaration):
<a4j:jsFunction name="sendInfo"> <a4j:param name="param1" assignTo="#{BackingBean.search.currentAutocomplete}"></a4j:param> </a4j:jsFunction>
Just, when the user puts the focus on a specific autocomplete "sendInfo" is executed with one parameter which is bound to the backing bean.
This solved my issue.
Greets,
Joseph