it turns out using <a4j:region id="scriptSuggested" >
doesn't generate an html section that A4J can rerender, I had to use <a4j:outputPanel>
, so now it updates the function, my code now looks like :
<a4j:region >
<a4j:outputPanel id="scriptSuggested">
<f:verbatim>
<script>
reallyUpdateIt = function () {
// javascript code that changes after aj4 ajax call is triggered
}
</script>
</f:verbatim>
<a4j:jsFunction reRender="scriptSuggested" ignoreDupResponses="true" ajaxSingle="true" name="updateSuggestionValues" action="#{bean.action}" oncomplete="reallyUpdateIt();">
<a4j:actionparam name="userInput" assignTo="#{bean.input}" />
</a4j:jsFunction>
</a4j:outputPanel>
</a4j:region>