簡體   English   中英

請求錯誤,狀態:0彈出a4j:support

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM