Primefaces p:remotecommand在IE 8中不起作用

use*_*436 5 primefaces jsf-2

我在我的JSF应用程序中使用p:remoteCommand.我有7个不同的p:remoteCommand声明在bean中调用不同的动作.在单击按钮时,将同时调用这7个远程命令.调用JS函数,但是某些时候对服务器的请求没有被执行,这只发生在IE上.我只在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" />
Run Code Online (Sandbox Code Playgroud)

bje*_*ski 0

我可以看到您正在使用async="true"所有远程命令。根据 bean 的类型,这可能会出现问题。您正在尝试以异步方式执行这些命令。如果这是绝对必要的,可能回答可能没有帮助,但请async="true"改为async="false"。这很可能会解决您的问题。

primefaces论坛上也报告了这个问题,这也有帮助。