添加primefaces ajax时未调用JSF commandbutton

添加primefaces ajax时未调用JSF commandbutton,jsf,primefaces,jsf-2.2,Jsf,Primefaces,Jsf 2.2,我在尝试添加javascript函数以在调用命令按钮后调用时遇到了一个问题,但我只得到javascript函数“forGo()”当我删除p:ajax代码时,被调用的是托管bean中的函数寄存器,而不是函数寄存器。该函数已成功执行,但我也需要执行放弃的函数。两年前我编写了此代码,它运行良好,任何建议都会有帮助,谢谢 <p:commandButton value="Register" actionListener="#{ClientMB.Register()}" >

我在尝试添加javascript函数以在调用命令按钮后调用时遇到了一个问题,但我只得到javascript函数“forGo()”当我删除p:ajax代码时,被调用的是托管bean中的函数寄存器,而不是函数寄存器。该函数已成功执行,但我也需要执行放弃的函数。两年前我编写了此代码,它运行良好,任何建议都会有帮助,谢谢

<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" >
                                            <p:ajax event="click" oncomplete="forGo()"></p:ajax>
                                            </p:commandButton></h:form>

我建议删除
,直接使用
oncomplete属性:

<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" oncomplete="forGo()" />

我建议删除
,直接使用
oncomplete属性:

<p:commandButton value="Register" actionListener="#{ClientMB.Register()}" oncomplete="forGo()" />