2012-11-12 121 views
5

我在我的JSF應用程序中使用p:remoteCommand。我有7個不同的p:remoteCommand聲明來調用bean中的不同動作。點擊按鈕時,同時調用這7個遠程命令。 JS函數被調用,但有時候對服務器的請求沒有被執行,這隻發生在IE上。我只在IE 8上測試過。Primefaces p:remotecommand在IE中不工作8

我試圖檢查在AJAX調用中返回的錯誤是什麼,但是我得到的是 xhr = error,status = Unknown,error = undefined。

我的功能和p:remoteCommand是如下:

function loadResult() { 
    loadSmry(); 
    load1(); 
    load2(); 
    load3(); 
    load4(); 
    load5(); 
    load6(); 
} 

<p:remoteCommand id="loadId" 
       name="loadSmry" 
       async="true" 
       action="#{designBean.saveSmry}" 
       process="@this" 
       onsuccess="summaryCount=0;" 
       onerror="handleXhrError(xhr, status, error)" 
       update="logId"/> 

<p:remoteCommand id="loadId1" 
       name="load1" 
       async="true" 
       action="#{designBean.showChrt1}" 
       onstart="showAjaxLoader('begin',1)" 
       oncomplete="showAjaxLoader('success',1)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart1" /> 

<p:remoteCommand id="loadId2" 
       name="load2" 
       async="true" 
       action="#{designBean.showChrt2}" 
       onstart="showAjaxLoaderForSummary('begin',2)" 
       oncomplete="showAjaxLoader('success',2)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart2" /> 


<p:remoteCommand id="loadId3" 
       name="load3" 
       async="true" 
       action="#{designBean.showChrt3}" 
       onstart="showAjaxLoader('begin',3)" 
       oncomplete="showAjaxLoader('success',3)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart3" /> 


<p:remoteCommand id="loadId4" 
       name="load4" 
       async="true" 
       action="#{designBean.showChrt4}" 
       onstart="showAjaxLoader('begin',4)" 
       oncomplete="showAjaxLoader('success',4)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart4" /> 


<p:remoteCommand id="loadId5" 
       name="load5" 
       async="true" 
       action="#{designBean.showChrt5}" 
       onstart="showAjaxLoader('begin',5)" 
       oncomplete="showAjaxLoader('success',5)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart5a chart5b" /> 

<p:remoteCommand id="loadId6" 
       name="load6" 
       async="true" 
       action="#{designBean.showChrt6}" 
       onstart="showAjaxLoader('begin',6)" 
       oncomplete="showAjaxLoader('success',6)" 
       onerror="handleXhrError(xhr, status, error)" 
       process="@this"      
       update="chart6" /> 
+0

任何嵌套窗體的機會? – Daniel

+0

@Daniel沒有嵌套表格 – user1817436

+0

爲什麼這些ID? ;圖表5a圖表5b;也許; chart5a chart5b; (沒有空格),也可以嘗試刪除命令以查看哪一個能夠解決問題...... – Daniel

回答

0

我可以看到你在你的所有遠程命令使用async="true"。根據bean的類型,這可能會有問題。您正嘗試以異步方式執行這些命令。如果這是絕對必要的,可能回答可能無濟於事,但請將async="true"更改爲async="false"。這很可能會解決你的問題。

在primefaces forum上也報告過這個問題,這也有幫助。