2012-11-12 36 views
5

Tôi sử dụng p: remoteCommand trong ứng dụng JSF của tôi. Tôi có 7 p khác nhau: remoteCommand tuyên bố để gọi hành động khác nhau trong đậu. Khi nhấp vào nút, 7 lệnh từ xa này được gọi cùng một lúc. Hàm JS được gọi nhưng yêu cầu đến máy chủ đôi khi không được thực thi và điều này chỉ xảy ra trên IE. Tôi chỉ thử nghiệm trên IE 8.Primefaces p: remotecommand không hoạt động trong IE 8

Tôi đã thử kiểm tra xem lỗi nào đang được trả lại trong AJAX được gọi nhưng tất cả tôi nhận được là xhr = lỗi, trạng thái = Không xác định và lỗi = không xác định.

My chức năng và p: remoteCommand là như sau:

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

bất kỳ cơ hội nào cho các hình thức lồng nhau? – Daniel

+0

@Daniel Không có hình thức lồng nhau – user1817436

+0

tại sao các id đó? biểu đồ chart5a 5b; có thể; chart5a chart5b; (không có khoảng trống), cũng có thể thử gỡ bỏ lệnh để xem cái nào làm phiền ... – Daniel

Trả lời

0

Tôi có thể thấy rằng bạn đang sử dụng async="true" trên tất cả các lệnh từ xa của bạn. Tùy thuộc vào loại đậu, điều này có thể có vấn đề. Bạn đang cố thực hiện các lệnh này theo cách không đồng bộ. Nếu điều này là hoàn toàn cần thiết, có thể câu trả lời có thể không hữu ích, nhưng vui lòng thay đổi async="true" thành async="false". Nó rất có khả năng rằng điều này sẽ giải quyết vấn đề của bạn.

Sự cố này cũng được báo cáo trên các nguyên tố forum và điều này cũng hữu ích.

Các vấn đề liên quan