[英]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.