I am facing an issue when trying to add javascript function to be called after the command button is called but I am only getting the javascript fuction "forGo()" being called but not the function register located in the managed bean when I remove the p:ajax code the function is executed succesfully but I need the forGo function to be executed too, I wrote this code two years ago and it was working fine, any advice would help, thanks.
<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" >
<p:ajax event="click" oncomplete="forGo()"></p:ajax>
</p:commandButton></h:form>