2013-09-21 26 views
0

我有一個問題,數據沒有得到刷新datatable.I打開一個dialoge框,其中我有手風琴面板在acordian面板我有選項卡中我有數據表。primefaces數據表沒有得到刷新在選項卡

<p:dialog id="dlgAddEditFundsCustFinAcct"    
       widgetVar="dlgAddEditFundsCustFinAcctWidget" modal="true" 
' 
. 
<p:accordionPanel id="accAEFCFA" widgetVar="accWidget"> 
    <p:tab id="tabDocuments" widgetVar="tabDocumentsWidget"> 
<p:panel id="pnlDocuments" widgetVar="pnlDocumentsWidget" > 
<p:panelGrid id="pgDocumentTable" columns="5"> 
<p:dataTable id="dtDocumentTable" var="documentRecord" value="#addEditFundsCustFinAcctManagedBean.documentDetails}"   widgetVar="documentTable"> 

而且我已正確關閉所有選項卡。

,我試圖調用使用

<p:commandButton value="Yes" styleClass="button-green" 
id="btnAddSellerAccountSsr"     oncomplete="confirmAccountDialog.hide(),dlgAddEditFundsCustFinAcctWidget.show()" update=":parentForm:dlgAddEditFundsCustFinAcct" /> 

「parentForm」這個對話框是我的表單名稱。

一件事是,如果我在某些事件內部調用更新,例如在列上或rowclick上過濾,則數據在數據表中得到刷新。

回答

0
<p:commandButton value="Yes" styleClass="button-green" id="btnAddSellerAccountSsr" 
    oncomplete="confirmAccountDialog.hide(),dlgAddEditFundsCustFinAcctWidget.show()"  
    update="dtDocumentTable" > 
     <f:ajax render="dtDocumentTable"/> 
    </p:commandButton> 
+0

請技術開發者的條款詳細說明究竟是如何的問題引起的,這段代碼究竟是如何解決的,而不是使之成爲一個完全無用的搜索與查找遊戲。 – BalusC

0

使用兩種形式。一個用於對話框和其他父窗體,然後使用其ID更新對話框數據表

0

謝謝Saurabh和Zaido。

不幸的是這兩個解決方案都沒有爲我工作。 但我已經通過調用datatable的clearfilter方法解決了這個問題(這是客戶端方法)。

<p:commandButton value="Yes" styleClass="button-green" id="btnAddSellerAccountSsr" 
    oncomplete="confirmAccountDialog.hide(),**documentTable.clearFilters();"** 
    update="dtDocumentTable" > 
     <f:ajax render="dtDocumentTable"/> 
    </p:commandButton> 

其中documentTable是datatable的widgetVar。

希望這個解決方案將幫助誰擁有相同的問題:)任何一個

+0

我面臨同樣的問題,但無法解決它。你可以幫我嗎? –

相關問題