![](/img/trans.png)
[英]Call rich:modalPanel for every ajax request with out using a4j:status?
[英]request error, status : 0 pop up with a4j:support
当h:commandButton内的a4j:support触发onclick事件时,我遇到一个弹出窗口,显示错误消息“请求错误,状态:0”。
<h:commandButton id="btn1" action="#{beanA.method1}">
<a4j:support event="onclick" action="#{beanB.method1}" reRender="somePanelGrid" />
</h:commandButton>
我也尝试对beanB.method1使用a4j:jsFunction并使用h:commandButton的onclick属性,但错误始终显示在弹出/警告框中。 删除a4j:support可以消除错误; 但是,单击commandButton时,我仍然需要执行beanB.method1。 导致此错误的原因是什么? 有替代或更好的方法吗?
我认为这是因为你在同一时间发送多个请求给服务器端,当你点击,我宁愿调用beanB.method1()
在beanA.method1()
或延缓行动之一oncomplete
阶段来解决这个问题:
<a4j:jsFunction name="function1" action="#{beanB.method1}" reRender="somePanelGrid" />
<h:commandButton id="btn1" action="#{beanA.method1}" oncomplete="function1()" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.