2013-04-30 85 views
1

我想從managedBean如何更新從託管bean JSF2 primefaces

更新數據表中的數據表這個數據表裏面p:tabp:tabViewh:formp:dialog

我測試了這一點:但它不更新:

RequestContext.getCurrentInstance().update("tabView:lesarticles"); 

這裏的對話框:

<p:dialog id="dialogc" modal="true" header="Nouveau Article" 
    widgetVar="dlgc"> 

,這裏是形式(內部對話):

<h:form prependId="false" id="formdialogc"> 

的TabView的和DataTable:

<p:tabView id="tabView" style="font-size: 14px;"> 

      <!-- ajouter elements --> 
      <p:tab id="info_produit" title="Produits"> 



<p:dataTable id="lesarticles" var="car" widgetVar="carsTable" 
        rowKey="#{car.ligneCommandeFournisseurId}" 
        value="#{commandeMB.commande.ligneCommandeFournisseurs}"> 

是有什麼辦法可以解決這個問題

預先感謝您

+0

如果我正確解釋你的問題,你問的是如何從服務器更新瀏覽器的內容?這是不可能的。傳統的HTTP客戶端/服務器通信不能以這種方式工作。或者,也許我誤解了你的問題?如果是這樣,你可以重新說出你的問題,使其更清楚嗎? – Jens 2013-04-30 15:30:10

回答

0

那應該很簡單:

<p:commandLink action="#{bean.getList}" update=":dataTableForm"/> 

在的GetList方法,我假設你刷新這是在p:dataTable所示的列表:

<h:form id="dataTableForm"> 
    <p:dataTable/> 
</h:form> 

只要確保你沒有嵌套形式單獨他們,讓他們做自己的本職工作。